aboutsummaryrefslogtreecommitdiff
path: root/bpkg/common-options.cli
blob: afeec7774677f04839a9df916d07e4936a289438 (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
// file      : bpkg/common-options.cli
// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

include <vector>;
include <cstdint>;
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}."
    };

    std::uint16_t --verbose = 1
    {
      "<level>",
      "Set the diagnostics verbosity to <level> between 0 (disabled) and
       6 (lots of information). The default is 1. @@ Need to document
       further."
    };

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

    // 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."
    };
  };
}