Using boost::program_options, I'd like to allow only --option=arg
style for arguments and forbid the space separated --option arg
which is sometimes ambiguous when arguments are optional.
Looks kind of possible. Having a look at cmdline.hpp source (found no documentation), I tried to use a restricted option style including only allow_long
and long_allow_adjacent
, and without long_allow_next
:
int optStyle =
po::command_line_style::allow_long |
po::command_line_style::long_allow_adjacent;
po::command_line_parser parser(argc, argv);
parser.style(optStyle);
Unfortunately --option arg
are still accepted by this parser...
Bug maybe? (libboost_program_options-1_46.so.1.46.1)