You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some arguments are exclusive.
Current workaround is to implement checks after the parsing like so :
[...]
program.parse_args(ac, av);
if (program.is_used("--foo") && program.is_used("--bar")) {
throw"--foo and --bar are exclusive !";
}
Furthermore, some parameters often require others to be present in order to be meaningfull.
Once again, we currently need to check manualy that both are given.
It would be nice to be able to use constructs like this :
program.add_argument("--line").needs("--file");
program.add_argument("--file").exclusive("--ip");
program.add_argument("--ip"); // No need to specify again that they are exclusive
program.add_argument("--port").needs("--ip").default_value(443);
try {
program.parse_args(ac, av);
} catch (const std::runtime_error& err) {
std::cerr << "Wrong arguments: " << err.what() << std::endl;
}
Some arguments are exclusive.
Current workaround is to implement checks after the parsing like so :
Furthermore, some parameters often require others to be present in order to be meaningfull.
Once again, we currently need to check manualy that both are given.
It would be nice to be able to use constructs like this :
Usage :
The text was updated successfully, but these errors were encountered: