aboutsummaryrefslogtreecommitdiff
path: root/libbutl/builtin.cli
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-09-06 22:20:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-09-27 17:08:05 +0300
commit1c6758009e82c47b5b341d418be2be401ef31482 (patch)
treed3ef8c053280477086f6230e3d25ff90b25871a2 /libbutl/builtin.cli
parent070871d97b4f6440c3f0fc647ece73b53a5837db (diff)
Add builtins support
Diffstat (limited to 'libbutl/builtin.cli')
-rw-r--r--libbutl/builtin.cli82
1 files changed, 82 insertions, 0 deletions
diff --git a/libbutl/builtin.cli b/libbutl/builtin.cli
new file mode 100644
index 0000000..284a111
--- /dev/null
+++ b/libbutl/builtin.cli
@@ -0,0 +1,82 @@
+// file : libbutl/builtin.cli
+// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+include <string>;
+include <vector>;
+
+// Note that options in this file are undocumented because we generate neither
+// the usage printing code nor man pages. Instead, they are documented in the
+// Testscript Language Manual's builtin descriptions.
+//
+// @@ Update the above reference when the documentation is moved to another
+// place.
+//
+// Also note that the string type is used for the path options because their
+// parsing depends on the working directory (see parse_path() for details) and
+// passing this information to the CLI custom parser would not be easy.
+//
+namespace butl
+{
+ class cat_options
+ {
+ // No options so far.
+ //
+ };
+
+ class cp_options
+ {
+ bool --recursive|-R|-r;
+ bool --preserve|-p;
+ };
+
+ class ln_options
+ {
+ bool --symbolic|-s;
+ };
+
+ class mkdir_options
+ {
+ bool --parents|-p;
+ };
+
+ class mv_options
+ {
+ bool --force|-f;
+ };
+
+ class rm_options
+ {
+ bool --recursive|-r;
+ bool --force|-f;
+ };
+
+ class rmdir_options
+ {
+ bool --force|-f;
+ };
+
+ class sed_options
+ {
+ bool --quiet|-n;
+ bool --in-place|-i;
+ std::vector<std::string> --expression|-e;
+ };
+
+ class sleep_options
+ {
+ // No options so far.
+ //
+ };
+
+ class test_options
+ {
+ bool --file|-f;
+ bool --directory|-d;
+ };
+
+ class touch_options
+ {
+ std::string --after; // Path (see above).
+ };
+}