Opened 9 years ago
Closed 8 years ago
#9630 closed Bugs (fixed)
Program Options: canonical option name incorrect when hyphenated
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | To Be Determined | Component: | program_options |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | Cc: |
Description
When using a long option name like "external-device", if there is a problem, the name of the option in the error message is printed as "--device" instead of "--external-device". This is due to the implementation in error_with_option_name::get_canonical_option_name() in the value_semantic.cpp file. It calls strip_prefixes() when assigning the value to original_token. But strip_prefixes() simply uses find_last_of("-/"), which finds the dash within the option name and incorrectly uses the following character as the start of the option name.
I don't know the proper fix to apply in order to not cause errors in other uses of these functions.
Change History (3)
follow-up: 2 comment:1 by , 8 years ago
comment:2 by , 8 years ago
I agree that the problem has been fixed, but I am (apparently) not authorized to close the ticket.
comment:3 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Looks like this may have been fixed by
https://svn.boost.org/trac/boost/changeset/82805
and see ticket
https://svn.boost.org/trac/boost/ticket/8009
(I was having the same error with 1.54 and came to look up if/when it was fixed, found this ticket in addition to the other one).
Maybe you could close it if it works for you now?