id summary reporter owner description type status milestone component version severity resolution keywords cc 564 program_options: additional parser bug nobody Vladimir Prus "{{{ alexander.kondratyuk@gmail.com It seems there is a bug in additional parser wrapper - in case then my option has no parameters defined and declared in description, it adds an empty value to the vector of values when additional paser returns pair of strings. Changing code in cmdline.cpp in function cmdline::handle_additional_parser from next.value.push_back(r.second); to if (!r.second.empty()) next.value.push_back(r.second); will fix the problem. Here is an example that illustrates the problem: #define BOOST_WHATEVER_DYN_LINK #define BOOST_LIB_DIAGNOSTIC #include #include #include #include #include #include using namespace boost::program_options; #include #include using namespace std; pair parserDashDashShort(const string& s) { string str = s.substr( 0, s.find('=') ); if( str.length()==3 && str[0]=='-' && str[1]=='-' && str[2]<='z' && str[2]>='a') { string val = s.substr(str.length()); return make_pair( str.substr(1), val ); } return make_pair(string(), string()); } int _tmain(int , _TCHAR* argv[]) { int style = command_line_style::allow_short| command_line_style::allow_dash_for_short | command_line_style::short_allow_adjacent; options_description desc; desc.add_options() (""help,h"", ""help message"") ; char* args[]={""program.exe"", ""--h""}; int argc = sizeof( args ) / sizeof( args[0] ); parse_command_line( argc, (char**)args, desc, style, parserDashDashShort ); return 0; } }}}" Bugs closed None None Fixed