Skip to content
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

NextLineHelp should still indent help past the option to improve readability #587

Closed
joshtriplett opened this issue Jul 18, 2016 · 4 comments
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations

Comments

@joshtriplett
Copy link
Contributor

My help string looks like this:

FLAGS:
    -h, --help      Prints help information
        --stdout    Write patches to stdout rather than files.

OPTIONS:
        --in-reply-to <Message-Id>    Make the first mail a reply to the specified Message-Id

If I try to make that more readable by setting NextLineHelp for --in-reply-to, I get this instead:

FLAGS:
    -h, --help      Prints help information
        --stdout    Write patches to stdout rather than files.

OPTIONS:
        --in-reply-to <Message-Id>
       Make the first mail a reply to the specified Message-Id

I think this would look more readable:

FLAGS:
    -h, --help      Prints help information
        --stdout    Write patches to stdout rather than files.

OPTIONS:
        --in-reply-to <Message-Id>
                    Make the first mail a reply to the specified Message-Id

This becomes even more important in a list of multiple options on adjacent lines.

@kbknapp
Copy link
Member

kbknapp commented Jul 23, 2016

I agree, it should at least indent one indentation past the --. I'll add this to the queue 😉 👍

@kbknapp kbknapp added C-enhancement Category: Raise on the bar on expectations P4: nice to have A-help Area: documentation, including docs.rs, readme, examples, etc... labels Jul 23, 2016
@joshtriplett
Copy link
Contributor Author

Not just "one indentation past"; ideally, it should line up with the help messages for non-NextLineHelp options.

It would also be nice to have an AppSettings setting that makes Clap limit the maximum width of the option name/value column, and automatically uses NextLineHelp otherwise. (Or, ideally, that could become the default.)

@kbknapp
Copy link
Member

kbknapp commented Jul 23, 2016

Hmm, I'll have to think about how to best do that. I agree it's the most aesthetically pleasing, but depending on the changes required to implemented we'll see. Lining them up using the internal variable longest should make this somewhat easy.

Good idea, could you open a new issue for the maximum length idea. It will most likely be implemented similar to how the maximum terminal width is implemented with a dedicated method on App.

@joshtriplett
Copy link
Contributor Author

Done in #597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

2 participants