Ticket #6991: po.patch
File po.patch, 1.9 KB (added by , 10 years ago) |
---|
-
boost/program_options/detail/cmdline.hpp
107 107 std::vector<option> parse_disguised_long_option( 108 108 std::vector<std::string>& args); 109 109 std::vector<option> parse_terminator( 110 std::vector<std::string>& args );110 std::vector<std::string>& args, bool alwaysStop); 111 111 std::vector<option> handle_additional_parser( 112 112 std::vector<std::string>& args); 113 113 -
libs/program_options/src/cmdline.cpp
241 241 if ((m_style & allow_short) && (m_style & allow_slash_for_short)) 242 242 style_parsers.push_back(boost::bind(&cmdline::parse_dos_option, this, _1)); 243 243 244 style_parsers.push_back(boost::bind(&cmdline::parse_terminator, this, _1 ));244 style_parsers.push_back(boost::bind(&cmdline::parse_terminator, this, _1, false /* or true for the behavior I want */)); 245 245 246 246 vector<option> result; 247 247 while(!args.empty()) … … 664 664 } 665 665 666 666 vector<option> 667 cmdline::parse_terminator(vector<string>& args )667 cmdline::parse_terminator(vector<string>& args, bool alwaysStop) 668 668 { 669 669 vector<option> result; 670 670 const string& tok = args[0]; 671 if (tok == "--" )671 if (tok == "--" || alwaysStop) 672 672 { 673 for(unsigned i = 1; i < args.size(); ++i) 673 // Starting at index 1 skips the --. 674 unsigned start = tok == "--" ? 1 : 0; 675 for(unsigned i = start; i < args.size(); ++i) 674 676 { 675 677 option opt; 676 678 opt.value.push_back(args[i]);