#4644 closed Patches (fixed)
Do not print empty long program option name
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | To Be Determined | Component: | program_options |
Version: | Boost 1.44.0 | Severity: | Cosmetic |
Keywords: | Cc: |
Description
This patch partially solves the problem when there is only short option name for the parameter and option_description class generates ugly help message. For example -
{{{(",w", po::value<int>(), "Perfrom write with N frames")}}}
generates this
{{{-w [ -- ] arg : Perfrom write with N frames}}}
The "[ -- ]" part is confusing. So if long option name is empty, we don't print that part.
Ideally, we should also print one dash for single character long option name if command_line_style::allow_long_disguise is specified, but I can't find a way to access those styles from option_description.
Originally, the problem found by a guy at Stack Overflow - http://stackoverflow.com/questions/3621181/short-options-only-in-boostprogram-options
Attachments (1)
Change History (6)
by , 12 years ago
Attachment: | options_description.cpp.diff added |
---|
comment:1 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
Thanks for the patch, I've checked it in. About style and long disguise -- I'm not sure we can do anything, because the parsing style is only know when we actually parse things.
comment:4 by , 10 years ago
Is there any chance that this feature request will be included into a release. I won't call this a showstopper but still would this make the library more complete from a library user point of view.
comment:5 by , 10 years ago
Ehm, that patch is in the release branch. Since 2012-04-08. So not only it's included in next release, but also in the last one.
Diff for the option_description fix