aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorthecharlesblake2018-10-13 21:03:26 +0100
committerthecharlesblake2018-10-13 21:05:42 +0100
commit7f52c283e5ac4a42aee6e51d1c2be4fc9723607a (patch)
tree5169c9b9411f0528898453993ba2377dbcc9b0d1 /src/main
parentMerge pull request #97 from thecharlesblake/comma-bug-ctd (diff)
downloadmetasol-7f52c283e5ac4a42aee6e51d1c2be4fc9723607a.tar.gz
metasol-7f52c283e5ac4a42aee6e51d1c2be4fc9723607a.zip

Add deal-print cmdln option

Diffstat (limited to 'src/main')
-rw-r--r--src/main/input-output/input/command_line_helper.cpp13
-rw-r--r--src/main/input-output/input/command_line_helper.h3
2 files changed, 12 insertions, 4 deletions
diff --git a/src/main/input-output/input/command_line_helper.cpp b/src/main/input-output/input/command_line_helper.cpp
index 365fe3f..6114170 100644
--- a/src/main/input-output/input/command_line_helper.cpp
+++ b/src/main/input-output/input/command_line_helper.cpp
@@ -56,9 +56,10 @@ command_line_helper::command_line_helper()
" runs first with both streamliners and a 10% timeout. If this"
" is unsuccessful (unsolvable or timeout), then runs again without streamliners.")
("benchmark", "outputs performance statistics for the solver on the "
- "supplied solitaire game. Must supply "
- "either 'random', 'benchmark', 'solvability' or list of deals to be "
- "solved.");
+ "supplied solitaire game. Must supply "
+ "either 'random', 'benchmark', 'solvability' or list of deals to be "
+ "solved.");
+ ("deal-only", "outputs the starting deal for a given game / random deal as json");
po::options_description hidden_options("Hidden options");
hidden_options.add_options()
@@ -97,6 +98,8 @@ bool command_line_helper::parse(int argc, const char* argv[]) {
classify = (vm.count("classify") != 0);
+ deal_only = (vm.count("deal-only") != 0);
+
if (vm.count("input-files")) {
input_files = vm["input-files"].as<vector<string>>();
}
@@ -273,6 +276,10 @@ bool command_line_helper::get_classify() {
return classify;
}
+bool command_line_helper::get_deal_only() {
+ return deal_only;
+}
+
uint64_t command_line_helper::get_cache_capacity() {
return cache_capacity;
}
diff --git a/src/main/input-output/input/command_line_helper.h b/src/main/input-output/input/command_line_helper.h
index 862e39f..f2a9d74 100644
--- a/src/main/input-output/input/command_line_helper.h
+++ b/src/main/input-output/input/command_line_helper.h
@@ -19,6 +19,7 @@ public:
const std::string get_rules_file();
int get_random_deal();
bool get_classify();
+ bool get_deal_only();
int get_solvability();
uint get_cores();
bool get_available_game_types();
@@ -40,7 +41,6 @@ private:
void print_too_many_opts_error();
void print_resume_error();
void print_streamliner_error(const std::string&);
- void print_streamliner_solvability_error();
boost::program_options::options_description cmdline_options;
boost::program_options::options_description main_options;
@@ -53,6 +53,7 @@ private:
int random_deal;
bool help;
bool classify;
+ bool deal_only;
int solvability;
std::vector<int> resume;
uint cores;