Opened 7 years ago

Last modified 6 years ago

#12091 new Bugs

help2man compatibility: add one more space between "arg" and description

Reported by: Timo Weingärtner <timo@…> Owned by: Vladimir Prus
Milestone: To Be Determined Component: program_options
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

help2man splits the option name and its description at two (or more) spaces. When using a longest option with an argument there is only one space between "arg" and the option description text.

Attachments (5)

makefile (145 bytes ) - added by Timo Weingärtner <timo@…> 7 years ago.
potest.C (749 bytes ) - added by Timo Weingärtner <timo@…> 7 years ago.
potest.help2man (113 bytes ) - added by Timo Weingärtner <timo@…> 7 years ago.
0001-improve-option_column_width-calculation.patch (3.2 KB ) - added by Timo Weingärtner <timo@…> 6 years ago.
0002-fixup-improve-option_column_width-calculation.patch (1017 bytes ) - added by Timo Weingärtner <timo@…> 6 years ago.

Download all attachments as: .zip

Change History (9)

by Timo Weingärtner <timo@…>, 7 years ago

Attachment: makefile added

by Timo Weingärtner <timo@…>, 7 years ago

Attachment: potest.C added

by Timo Weingärtner <timo@…>, 7 years ago

Attachment: potest.help2man added

comment:1 by Vladimir Prus, 7 years ago

Timo,

thanks for your report. However, at presents I'm a bit reluctant to change output format to accomodate a particular tool. I don't think this was a concern anybody raised previously.

comment:2 by Timo Weingärtner <timo@…>, 7 years ago

for options without arguments there are at least two spaces, so the bug is in the probably unwanted special behavior for options with arguments

by Timo Weingärtner <timo@…>, 6 years ago

comment:3 by Timo Weingärtner <timo@…>, 6 years ago

OK, I looked into the source and found out that two spaces are intended according to a comment in options_description::get_option_column_width().

I found more subtle bugs in this function and fixed them as well, the function should now also be easier to understand.

Beware: the patch is only compile-tested with vim-youcompleteme, I don't have a test infrastructure set up for boost.

by Timo Weingärtner <timo@…>, 6 years ago

comment:4 by Timo Weingärtner <timo@…>, 6 years ago

Version: Boost 1.58.0Boost 1.61.0

I've had the time to actually build it and fixed an off-by-one error (attached).

Note: See TracTickets for help on using tickets.