To have a parameter without a value (passing means that it is set to true ), you must create it like this :
options_description desc; desc.add_options() ("help", "produce help message")
To use a notifier for such a parameter, you can use the following type as semantics:
boost::program_options::bool_switch()
it can be true or false , and no value can be explicitly used for this option from the command line. If the option is passed, then true . If it fails, false .
source share