Opened 10 years ago
Closed 10 years ago
#8009 closed Patches (fixed)
Error message does not show correct option name, if it contains a hyphen
| Reported by: | Owned by: | Vladimir Prus | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | program_options | 
| Version: | Boost 1.54.0 | Severity: | Problem | 
| Keywords: | Cc: | 
Description
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.
Attachments (2)
Change History (3)
by , 10 years ago
| Attachment: | boost-program-options-hyphen-bug.tar.gz added | 
|---|
comment:1 by , 10 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
  Note:
 See   TracTickets
 for help on using tickets.
    
Simple bug reproducing example.