Is there any way of making program options dependent on other options using boost::program_options
?
For example, my program can accept the following sample arguments:
wifi --scan --interface=en0
wifi --scan --interface=en0 --ssid=network
wifi --do_something_else
In this example, the interface
and ssid
arguments are only valid if they are accompanied by scan
. They are dependent on the scan
argument.
Is there any way to enforce this automatically with boost::program_options
? It can of course be implemented manually but it seems like there must be a better way.
po::value<stuff>()
bit) and option_description – Laudianism