]> git.tdb.fi Git - builder.git/blobdiff - source/buildercli.h
Separate the command-line interface into its own class
[builder.git] / source / buildercli.h
diff --git a/source/buildercli.h b/source/buildercli.h
new file mode 100644 (file)
index 0000000..ac88752
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef BUILDERCLI_H_
+#define BUILDERCLI_H_
+
+#include <msp/core/application.h>
+#include "builder.h"
+
+class Analyzer;
+
+class BuilderCLI: public Msp::RegisteredApplication<BuilderCLI>
+{
+private:
+       typedef std::list<std::string> NameList;
+
+       NameList cmdline_targets;
+       Config::InputOptions cmdline_options;
+       Msp::FS::Path cwd;
+
+       Builder builder;
+       Logger logger;
+       Analyzer *analyzer;
+       bool build;
+       unsigned clean;
+       bool dry_run;
+       bool help;
+       bool show_progress;
+       std::string build_file;
+       unsigned jobs;
+       NameList what_if;
+       bool conf_all;
+       bool conf_only;
+       bool build_all;
+       bool create_makefile;
+
+       static std::string usagemsg;
+       static std::string helpmsg;
+
+public:
+       BuilderCLI(int, char **);
+       ~BuilderCLI();
+
+       virtual int main();
+
+       bool prepare_build();
+
+       static void usage(const char *, const char *, bool);
+       void package_help();
+};
+
+#endif