Opened 13 years ago
Last modified 8 years ago
#3343 new Feature Requests
[Program options] add option to place description on the next line in output
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | To Be Determined | Component: | program_options |
Version: | Boost 1.39.0 | Severity: | Optimization |
Keywords: | Cc: |
Description
If some param has long length and default value, then description of such param (and other params) has ugly output - very narrow text column.
If it is possible then please deal with this issue.
For example, description of some option could be placed on the second line after its-name-and-default-value line.
Change History (6)
comment:1 by , 13 years ago
comment:2 by , 12 years ago
I want to add my vote to this request. The output format is completely unusable like that. In my specific case there are 7 characters left for the text. I would propose to always output the description at column 13 (or maybe 20), formating it as shown in the following example:
--parameter_name arg (="a very long default string") This options does something stupid to the "very long default string" which you can pass in after the parameter name. --help Print this help --foo A small option name but a very long description which continues and continues until it breaks.
best regards,
Brian
comment:3 by , 12 years ago
Component: | None → program_options |
---|---|
Milestone: | Boost 1.41.0 → To Be Determined |
comment:4 by , 10 years ago
This feature request seems to have been abandoned, but it would really be wonderful if it could be implemented. Even better would be to have some options to control the formatting, so that we could specify the columns used to align the option names, arguments, and descriptions, the column number for breaking to the next line, whether or not default arguments values are displayed (and how they are displayed, in the case of an enum for example), and whether to put descriptions on a separate line beneath each option.
Thanks for considering this.
comment:5 by , 9 years ago
I'd like to vote for this feature request as well, in the sense that more flexibility would be useful here in general. I'm wondering whether a solution would be to give the building blocks of the formatting engine (currently hidden in the .cpp file in an anonymous namespace) a public interface, allowing users to use them individually and to replace or extend them as needed. For instance, I'd like to sort my options alphabetically, and this would be easy if format_description() & Co. had a public interface. I think this would make it relatively easy to solve this feature request - or leave the users with the possibility to do that themselves.
comment:6 by , 8 years ago
+1 I was surprised to find that the format of command line output is hard coded. As a minimum, one should be able to:
- Specify column no that description starts at.
- Be able to have default values printed as part of the description (after the description) or not at all.
I'd like to second this feature request. We have a number of programs with a number of options for which an absolute file name is the default. That can easily squash the description column to only a few words wide. It would be much better if the description were on a second line.