aboutsummaryrefslogtreecommitdiff
path: root/bbot/worker/worker-options.hxx
blob: 15e5b664f6ca65db23e10cb7f07687ad1b251e85 (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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// -*- C++ -*-
//
// This file was generated by CLI, a command line interface
// compiler for C++.
//

#ifndef BBOT_WORKER_WORKER_OPTIONS_HXX
#define BBOT_WORKER_WORKER_OPTIONS_HXX

// Begin prologue.
//
//
// End prologue.

#include <bbot/common-options.hxx>

namespace bbot
{
  class worker_options
  {
    public:
    worker_options ();

    // Return true if anything has been parsed.
    //
    bool
    parse (int& argc,
           char** argv,
           bool erase = false,
           ::bbot::cli::unknown_mode option = ::bbot::cli::unknown_mode::fail,
           ::bbot::cli::unknown_mode argument = ::bbot::cli::unknown_mode::stop);

    bool
    parse (int start,
           int& argc,
           char** argv,
           bool erase = false,
           ::bbot::cli::unknown_mode option = ::bbot::cli::unknown_mode::fail,
           ::bbot::cli::unknown_mode argument = ::bbot::cli::unknown_mode::stop);

    bool
    parse (int& argc,
           char** argv,
           int& end,
           bool erase = false,
           ::bbot::cli::unknown_mode option = ::bbot::cli::unknown_mode::fail,
           ::bbot::cli::unknown_mode argument = ::bbot::cli::unknown_mode::stop);

    bool
    parse (int start,
           int& argc,
           char** argv,
           int& end,
           bool erase = false,
           ::bbot::cli::unknown_mode option = ::bbot::cli::unknown_mode::fail,
           ::bbot::cli::unknown_mode argument = ::bbot::cli::unknown_mode::stop);

    bool
    parse (::bbot::cli::scanner&,
           ::bbot::cli::unknown_mode option = ::bbot::cli::unknown_mode::fail,
           ::bbot::cli::unknown_mode argument = ::bbot::cli::unknown_mode::stop);

    // Option accessors.
    //
    const bool&
    help () const;

    const bool&
    version () const;

    const uint16_t&
    verbose () const;

    bool
    verbose_specified () const;

    const bool&
    bootstrap () const;

    const bool&
    startup () const;

    const bool&
    systemd_daemon () const;

    const dir_path&
    build () const;

    bool
    build_specified () const;

    const dir_path&
    environments () const;

    bool
    environments_specified () const;

    const path&
    env_script () const;

    bool
    env_script_specified () const;

    const string&
    env_target () const;

    bool
    env_target_specified () const;

    const string&
    tftp_host () const;

    bool
    tftp_host_specified () const;

    // Print usage information.
    //
    static ::bbot::cli::usage_para
    print_usage (::std::ostream&,
                 ::bbot::cli::usage_para = ::bbot::cli::usage_para::none);

    // Implementation details.
    //
    protected:
    bool
    _parse (const char*, ::bbot::cli::scanner&);

    private:
    bool
    _parse (::bbot::cli::scanner&,
            ::bbot::cli::unknown_mode option,
            ::bbot::cli::unknown_mode argument);

    public:
    bool help_;
    bool version_;
    uint16_t verbose_;
    bool verbose_specified_;
    bool bootstrap_;
    bool startup_;
    bool systemd_daemon_;
    dir_path build_;
    bool build_specified_;
    dir_path environments_;
    bool environments_specified_;
    path env_script_;
    bool env_script_specified_;
    string env_target_;
    bool env_target_specified_;
    string tftp_host_;
    bool tftp_host_specified_;
  };
}

// Print page usage information.
//
namespace bbot
{
  ::bbot::cli::usage_para
  print_bbot_worker_usage (::std::ostream&,
                           ::bbot::cli::usage_para = ::bbot::cli::usage_para::none);
}

#include <bbot/worker/worker-options.ixx>

// Begin epilogue.
//
//
// End epilogue.

#endif // BBOT_WORKER_WORKER_OPTIONS_HXX