This commit is contained in:
Matthias
2017-07-24 16:37:13 +02:00
parent 3d8f381bae
commit 6c3a14afc8
14 changed files with 266 additions and 2 deletions
+9 -1
View File
@@ -10,7 +10,8 @@
("if1", boost::program_options::value<bool>(), "if1 condition")
("if2", boost::program_options::value<bool>(), "if2 condition")
("if3", boost::program_options::value<bool>(), "if3 condition")
("if4", boost::program_options::value<bool>(), "if4 condition");
("if4", boost::program_options::value<bool>(), "if4 condition")
("ifall", boost::program_options::value<bool>(), "all if conditions");
boost::program_options::variables_map vm;
auto parsed = boost::program_options::command_line_parser(argc, argv).options(opts).allow_unregistered().run();
boost::program_options::store(parsed, vm);
@@ -31,6 +32,13 @@
if (vm.count("if4")) {
if4Cond = vm["if4"].as<bool>();
}
if (vm.count("ifall")) {
auto val = vm["ifall"].as<bool>();
if1Cond = val;
if2Cond = val;
if3Cond = val;
if4Cond = val;
}
std::cerr << "if1 = " << if1Cond << std::endl;
std::cerr << "if2 = " << if2Cond << std::endl;
std::cerr << "if3 = " << if3Cond << std::endl;