-
Notifications
You must be signed in to change notification settings - Fork 1.7k
improve readability of help text #2075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Or maybe, to save on horizontal screen real estate:
|
@Skeeve it does look neater, but wrapping the flags can lead to confusion. For example the 2 first lines don't make it obvious it is the same options. |
Maybe this way?
Alternatively, options without a help text could get an empty line. So let's assume the first two are different options where
Doesn't look nice, but on the other hand: What good is an option you do not explain? Or, instead of empty:
|
Or maybe something like this
|
T.b.h. A "/" would confuse me. Personally I would prefer a hint that there is no help for that option. As I said before: What good is an option you don't explain? With that hint the author might be tempted to add at least something. So any options on consecutive lines are the alternatives. If we really want a visual hint that they are alternatives, I guess the "OR" would be good. Maybe, to not confuse it with any flag-related values, indent it by a few blanks?
|
I just checked a few man pages (ls, curl, git). All of them go the "Comma-way" and "Option on its own line"
Except when the option is short:
And they always have an empty line between options. |
@Skeeve I like the idea of going with a more standardized output. Although curl help looks like this and doesn't wrap
@dearchap would it be acceptable for the project to include a few different standardized output printer as an option? |
Yes. That's the help page. I looked ad the man page. Usually they are different, as we can see here. Otoh: There is no man page option in cli, or is it? So the help is more or less also the man page. At least for me that is. And if you look at a standard help output of cli programs, the similarities to man pages are there, don't you think? |
Yes I've been dreaming up the idea of a "help personality". User can set the "help personality" to say |
Maybe take a look at what Pod::Usage in perl does. Okay… It extracts man and help text from "Plain Old Documentation", but maybe there is something which inspires you? Depending on what you pass to |
I had a look at the template system and I roughly understand how it works. If it's OK to break compatibility before release would you consider something along these lines:
|
Checklist
What problem does this solve?
Currently help text for flags is not very readable and looks all over the place, even when defining a custom Printer with a custom wrapAt
ex:
Notice when a default is declared the line for default indents further and is more readable.
Solution description
The lines which have been wrapped should also be indented to the same level as the
(default: ... )
text or simply to the start of the description column like in the docker documentation:currently I use this function to wrap the lines in the helper:
I would like the behavior to be:
"wrapTo":func(int)
or"indentBy":func(int)
Describe alternatives you've considered
A clear and concise description of any alternative solutions or
features you've considered.
The text was updated successfully, but these errors were encountered: