]> git.tdb.fi Git - builder.git/blobdiff - source/buildercli.h
Use default member initializers and constructor delegation
[builder.git] / source / buildercli.h
index 42ed0c350d81d62f584b9c13e42377362fe14c37..3b15541b6e65eed515924db15994bf6fe6bf39ca 100644 (file)
@@ -6,40 +6,42 @@
 
 class Analyzer;
 
+/**
+Provides a command-line interface for Builder.
+*/
 class BuilderCLI: public Msp::RegisteredApplication<BuilderCLI>
 {
 private:
-       typedef std::list<std::string> NameList;
-
-       NameList cmdline_targets;
+       std::vector<std::string> 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;
+       Analyzer *analyzer = 0;
+       bool build = false;
+       unsigned clean = 0;
+       bool dry_run = false;
+       bool help = false;
        std::string helpmsg;
-       bool show_progress;
-       std::string build_file;
-       unsigned jobs;
-       NameList what_if;
-       bool conf_all;
-       bool conf_only;
-       bool build_all;
-       bool create_makefile;
+       bool show_progress = false;
+       std::string build_file = "Build";
+       unsigned jobs = 1;
+       std::vector<std::string> what_if;
+       bool conf_all = false;
+       bool conf_only = false;
+       bool build_all = false;
+       bool create_makefile = false;
 
 public:
        BuilderCLI(int, char **);
        ~BuilderCLI();
 
-       virtual int main();
+       int main() override;
 
 private:
        bool prepare_build();
+       Target *resolve_target(const std::string &);
 
        void package_help();
 };