I'm using boost::program_options
, and this question is merely aesthetic.
How can I force a std::string
option (or better, all options) to use only long form with "="?
Right now, all I see is "=" being forced on my int
option, while the string isn't using the equal sign:
po::options_description desc("Allowed options");
desc.add_options()
(opt_help, "Show this help message")
(opt_int, po::value<int>()->implicit_value(10), "Set an int")
(opt_str, po::value<std::string>()->implicit_value(std::string()), "Set a string")
;
The above shows all options as --help
, --int=4
, --str FooBar
. I'd like options only in the form --option=something
.
I've tried some styles, but I didn't find the right one.
Cheers!