I am trying to get input options using boost::program_options
.
I would like to have two source of options one from command line and another from file but I also want to have different option names for the same value.
commandLine.add_options()
("dim,d", po::value<int>(&dimension), "Problem dimension")
("adv", po::value<bool>(&adv_enabled), "Enable/Disable advection term {1|0}")
("div", po::value<bool>(&div_enabled), "Enable/Disable divergance term {1|0}")
file_options.add_options()
("dimension",po::value<int>(&dimension), "Set Problem dimension")
("enable.advection", po::value<bool>(&adv_enabled), "Enable/Disable advection")
("enable.divergance", po::value<bool>(&div_enabled), "Enable/Disable divergance")
Here I want to use shorter versions in command line and grouped versions in file.
Is there a way to just pass the variable to both or should I parse them in code?