[Boost-bugs] [Boost C++ Libraries] #8009: Error message does not show correct option name, if it contains a hyphen

Subject: [Boost-bugs] [Boost C++ Libraries] #8009: Error message does not show correct option name, if it contains a hyphen
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-08 11:26:53


#8009: Error message does not show correct option name, if it contains a hyphen
-----------------------------------------------------+----------------------
 Reporter: Markus Roth <markus.roth@…> | Owner: vladimir_prus
     Type: Patches | Status: new
Milestone: To Be Determined | Component: program_options
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
-----------------------------------------------------+----------------------
 When using a long option with a '''hyphen''' in its name, the error string
 does not output the option name, but rather the substring from the
 rightmost hyphen position.

 Example: option foo-bar with double.
 {{{
 ./myprogram --foo-bar nonumber
 }}}

 Since "nonumber" cannot be cast into double, it throws an exception.
 The error message is:
 {{{
 "the argument ('nonumber') for option '--bar' is invalid"
 }}}

 Option name is wrongly quoted as '''"--bar"'''. Expected is '''"--foo-
 bar"'''.

 Check the attached example for reproduction. See the attached patch fixing
 the bug. SVN rev 82783.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8009>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC