aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cmdline.hxx
blob: 56e9510d81acf62aa82481a7090bb9ffcb421e8b (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
// file      : libbuild2/cmdline.hxx -*- C++ -*-
// license   : MIT; see accompanying LICENSE file

#ifndef LIBBUILD2_CMDLINE_HXX
#define LIBBUILD2_CMDLINE_HXX

#include <libbuild2/types.hxx>
#include <libbuild2/forward.hxx>
#include <libbuild2/utility.hxx>

#include <libbuild2/b-options.hxx>
#include <libbuild2/diagnostics.hxx>

#include <libbuild2/export.hxx>

namespace build2
{
  struct cmdline
  {
    strings cmd_vars;
    string buildspec;

    // Processed/meged option values (unless --help or --version specified).
    //
    uint16_t verbosity = 1;
    optional<bool> progress;
    optional<bool> mtime_check;
    optional<path> config_sub;
    optional<path> config_guess;
    size_t jobs = 0;
    size_t max_jobs = 0;
    optional<size_t> max_stack;
    bool fcache_compress = true;
  };

  LIBBUILD2_SYMEXPORT cmdline
  parse_cmdline (tracer&,
                 int argc, char* argv[],
                 options&,
                 uint16_t default_verbosity = 1,
                 size_t default_jobs = 0);
}

#endif // LIBBUILD2_CMDLINE_HXX