Boost C++ Libraries: Ticket #2577: ambigous program options https://svn.boost.org/trac10/ticket/2577 <p> Basically a variation of this regression: <a class="ext-link" href="http://lists.boost.org/Archives/boost/2006/01/98811.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2006/01/98811.php</a> </p> <p> To trigger it again you have to slightly modify the test case: </p> <pre class="wiki"># include &lt;iostream&gt; # include &lt;boost/program_options.hpp&gt; int main(int argc, char * argv[]) try { using namespace boost::program_options; options_description desc("Options"); desc.add_options() ("foo", "foo") ("foobar", "foobar") ("foo-bar", "foo-bar") ("barbar", "barbar") ("bar-bar", "bar-bar") ("bar", "bar") ; parsed_options parsed = parse_command_line(argc, argv, desc); variables_map vm; store(parsed, vm); notify(vm); std::cerr &lt;&lt; vm.count("foo") &lt;&lt; std::endl; std::cerr &lt;&lt; vm.count("foobar") &lt;&lt; std::endl; std::cerr &lt;&lt; vm.count("foo-bar") &lt;&lt; std::endl; std::cerr &lt;&lt; vm.count("bar") &lt;&lt; std::endl; std::cerr &lt;&lt; vm.count("barbar") &lt;&lt; std::endl; std::cerr &lt;&lt; vm.count("bar-bar") &lt;&lt; std::endl; } catch (std::exception &amp; ex) { std::cerr &lt;&lt; argv[0] &lt;&lt; ": " &lt;&lt; ex.what() &lt;&lt; std::endl; return EXIT_FAILURE; } </pre><pre class="wiki">$ ./a.out --foo 1 0 0 0 0 0 </pre><pre class="wiki">$ ./a.out --bar ./a.out: ambiguous option bar </pre><p> Btw, wouldn't it make more sense, if boost program_options would do its ambiguity checking as part of add_options()? I mean before the actual parsing step ... </p> <p> PS: Take a look at: <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/545"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/545</a> I get there: </p> <pre class="wiki">Oops… Trac detected an internal error: TypeError: a float is required </pre><p> }}} </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2577 Trac 1.4.3 Vladimir Prus Sat, 30 May 2009 10:40:44 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2577#comment:1 https://svn.boost.org/trac10/ticket/2577#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This problem does not happen in SVN HEAD. </p> Ticket