.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user