Boost C++ Libraries: Ticket #8009: Error message does not show correct option name, if it contains a hyphen https://svn.boost.org/trac10/ticket/8009 <p> When using a long option with a <strong>hyphen</strong> in its name, the error string does not output the option name, but rather the substring from the rightmost hyphen position. </p> <p> Example: option foo-bar with double. </p> <pre class="wiki">./myprogram --foo-bar nonumber </pre><p> Since "nonumber" cannot be cast into double, it throws an exception. The error message is: </p> <pre class="wiki">"the argument ('nonumber') for option '--bar' is invalid" </pre><p> Option name is wrongly quoted as <strong>"--bar"</strong>. Expected is <strong>"--foo-bar"</strong>. </p> <p> Check the attached example for reproduction. See the attached patch fixing the bug. SVN rev 82783. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8009 Trac 1.4.3 Markus Roth <markus.roth@…> Fri, 08 Feb 2013 11:27:30 GMT attachment set https://svn.boost.org/trac10/ticket/8009 https://svn.boost.org/trac10/ticket/8009 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-program-options-hyphen-bug.tar.gz</span> </li> </ul> <p> Simple bug reproducing example. </p> Ticket Markus Roth <markus.roth@…> Fri, 08 Feb 2013 11:27:53 GMT attachment set https://svn.boost.org/trac10/ticket/8009 https://svn.boost.org/trac10/ticket/8009 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-program-options-hyphen-bug.patch</span> </li> </ul> <p> Patch. </p> Ticket Vladimir Prus Sun, 10 Feb 2013 12:07:08 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8009#comment:1 https://svn.boost.org/trac10/ticket/8009#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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82805" title="Fix report of error for options with dashes. Fixes #8009. Patch from ...">[82805]</a>) Fix report of error for options with dashes. </p> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8009" title="#8009: Patches: Error message does not show correct option name, if it contains a hyphen (closed: fixed)">#8009</a>. Patch from Markus Roth. </p> Ticket