]> git.tdb.fi Git - builder.git/blob - source/buildercli.h
Separate the command-line interface into its own class
[builder.git] / source / buildercli.h
1 #ifndef BUILDERCLI_H_
2 #define BUILDERCLI_H_
3
4 #include <msp/core/application.h>
5 #include "builder.h"
6
7 class Analyzer;
8
9 class BuilderCLI: public Msp::RegisteredApplication<BuilderCLI>
10 {
11 private:
12         typedef std::list<std::string> NameList;
13
14         NameList cmdline_targets;
15         Config::InputOptions cmdline_options;
16         Msp::FS::Path cwd;
17
18         Builder builder;
19         Logger logger;
20         Analyzer *analyzer;
21         bool build;
22         unsigned clean;
23         bool dry_run;
24         bool help;
25         bool show_progress;
26         std::string build_file;
27         unsigned jobs;
28         NameList what_if;
29         bool conf_all;
30         bool conf_only;
31         bool build_all;
32         bool create_makefile;
33
34         static std::string usagemsg;
35         static std::string helpmsg;
36
37 public:
38         BuilderCLI(int, char **);
39         ~BuilderCLI();
40
41         virtual int main();
42
43         bool prepare_build();
44
45         static void usage(const char *, const char *, bool);
46         void package_help();
47 };
48
49 #endif