aboutsummaryrefslogtreecommitdiff
path: root/libbutl/builtin.cli
blob: adc47fad01437e828d59aa6a70de9b7b6394bec9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// file      : libbutl/builtin.cli
// 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 date_options
  {
    bool --utc|-u;
  };

  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).
  };
}