aboutsummaryrefslogtreecommitdiff
path: root/bpkg/common-options.cli
blob: 04c67e337dcf6867d94bcdaebe24eb4a2db03d5c (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// file      : bpkg/common-options.cli
// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

include <bpkg/types>;

namespace bpkg
{
  class common_options = 0
  {
    bool -v
    {
      "Print underlying commands being executed. This is equivalent to
       \cb{--verbose 2}."
    };

    bool -q
    {
      "Run quietly, only printing error messages. This is equivalent
       to \cb{--verbose 0}."
    };

    uint16_t --verbose = 1
    {
      "<level>",
      "Set the diagnostics verbosity to <level> between 0 (disabled) and
       6 (lots of information). The default is 1. The following additional
       classes of diagnostics are produced at each level:

       \ol|

       \li|high-level information messages|

       \li|essential underlying commands that are being executed|

       \li|all underlying commands that are being executed|

       \li|information that could be helpful to the user|

       \li|information that could be helpful to the developer|

       \li|even more detailed information||"
    };

    path --fetch
    {
      "<path>",
      "The fetch program that should be used to download remote resources.
       Currently, \cb{bpkg} recognizes \cb{curl}, \cb{wget}, and \cb{fetch}.
       Note that the last component of <path> must contain one of these
       names as a substring in order for \cb{bpkg} to recognize which
       program is being used. You can also specify additional options that
       should be passed to the fetch program with \cb{--fetch-option}.

       If the fetch program is not specified, then \cb{bpkg} will try to
       discover if one of the above program is available and use that.
       Currently, \cb{bpkg} has the following preference order: \cb{wget}
       1.16 or higher (supports \cb{--show-progress}), \cb{curl},
       \cb{wget}, and \cb{fetch}."
    };

    strings --fetch-option
    {
      "<opt>",
      "Additional option that should be passed to the fetch program. See
       \cb{--fetch} for more information on the fetch program. Repeat this
       option to specify multiple fetch options."
    };

    path --tar = "tar"
    {
      "<path>",
      "The tar program that should be used to extract package archives. For
       example, \cb{gtar} or \cb{bsdtar}. You can also specify additional
       options that should be passed to the tar program with
       \cb{--tar-option}. If the tar program is not explicitly specified,
       then \cb{bpkg} will use \cb{tar} by default."
    };

    strings --tar-option
    {
      "<opt>",
      "Additional option that should be passed to the tar program. See
       \cb{--tar} for more information on the tar program. Repeat this
       option to specify multiple tar options."
    };

    // The following option is "fake" in that it is actually handled by
    // argv_file_scanner. We have it here for documentation.
    //
    string --options-file
    {
      "<file>",
      "Read additional options from <file> with each option appearing on a
       separate line optionally followed by space and an option value. Empty
       lines and lines starting with \cb{#} are ignored. Option values can
       be enclosed in double (\cb{\"}) or single (\cb{'}) quotes to preserve
       leading and trailing whitespaces as well as to specify empty values.
       If the value itself contains trailing or leading quotes, enclose it
       with an extra pair of quotes, for example \cb{'\"x\"'}. Non-leading
       and non-trailing quotes are interpreted as being part of the option
       value.

       The semantics of providing options in a file is equivalent to providing
       the same set of options in the same order on the command line at the
       point where the \cb{--options-file} option is specified except that
       the shell escaping and quoting is not required. You can repeat this
       option to specify more than one options file."
    };
  };
}