To have an option with no value (passing means it is set true
) you should create it like this:
options_description desc;
desc.add_options()
("help", "produce help message")
To use notifier for such an option you can use the following type as semantics:
boost::program_options::bool_switch()
it can have true
or false
values and no value can be explicitly taken for this option from the command line. If the option is passed then the value is true
. If not passed - the value is false
.