aboutsummaryrefslogtreecommitdiff
path: root/src/main/input-output/input/command_line_helper.h
diff options
context:
space:
mode:
authorthecharlesblake2018-01-03 13:05:31 +0000
committerthecharlesblake2018-01-03 13:05:31 +0000
commit7f4712b292632becfc83bc0e887271b25fefd21a (patch)
tree0dd0201057886c7fda86a53b447cce5d04948d25 /src/main/input-output/input/command_line_helper.h
parentTidy up card class (diff)
downloadmetasol-7f4712b292632becfc83bc0e887271b25fefd21a.tar.gz
metasol-7f4712b292632becfc83bc0e887271b25fefd21a.zip

Refactor io dir structure

Diffstat (limited to 'src/main/input-output/input/command_line_helper.h')
-rw-r--r--src/main/input-output/input/command_line_helper.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/main/input-output/input/command_line_helper.h b/src/main/input-output/input/command_line_helper.h
new file mode 100644
index 0000000..fd1468c
--- /dev/null
+++ b/src/main/input-output/input/command_line_helper.h
@@ -0,0 +1,40 @@
+//
+// Created by thecharlesblake on 10/16/17.
+//
+
+#ifndef SOLVITAIRE_COMMAND_LINE_HELPER_H
+#define SOLVITAIRE_COMMAND_LINE_HELPER_H
+
+#include <boost/program_options.hpp>
+
+class command_line_helper {
+public:
+ command_line_helper();
+
+ bool parse(int argc, const char* argv[]);
+ const std::vector<std::string> get_input_files();
+ const std::string get_solitaire_type();
+ const std::string get_rules_file();
+ int get_random_deal();
+ bool get_help();
+
+private:
+ bool assess_errors();
+ bool assess_sol_type();
+ void print_help();
+ void print_no_input_error();
+ void print_sol_type_rules_error();
+ void print_rand_plus_input_err();
+
+ boost::program_options::options_description cmdline_options;
+ boost::program_options::options_description main_options;
+ boost::program_options::positional_options_description p;
+
+ std::vector<std::string> input_files;
+ std::string solitaire_type;
+ std::string rules_file;
+ int random_deal;
+ bool help;
+};
+
+#endif //SOLVITAIRE_COMMAND_LINE_HELPER_H