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

The help message offset is inconsistent #1013

Open
marmistrz opened this issue Jul 25, 2017 · 6 comments
Open

The help message offset is inconsistent #1013

marmistrz opened this issue Jul 25, 2017 · 6 comments
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-bug Category: Updating dependencies S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing

Comments

@marmistrz
Copy link

Rust Version

1.19.0

Affected Version of clap

2.25.1

Issue description

Take this Rust project: marmistrz/randmockery@3fa575f

(I specify the commit because the app may be developed further). When launching randmockery --help I get

randmockery 0.1.0
Marcin Mielniczuk <mail>
Proof-of-concept that we can mock randomness

USAGE:
    randmockery [OPTIONS] <command>...

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -l <library>...        Adds a library to be injected

ARGS:
    <command>...    The command to be executed

I'd expect all the help messages to be aligned to each other:

FLAGS:
    -h, --help             Prints help information
    -V, --version          Prints version information

OPTIONS:
    -l <library>...        Adds a library to be injected

ARGS:
    <command>...           The command to be executed
@kbknapp
Copy link
Member

kbknapp commented Oct 4, 2017

The alignment is per section (i.e. ARGS, FLAGS, etc.). In small programs like the example, I agree it looks better aligned as a single unit, but in large programs this actually looks worse (subjective opinion I know).

I'm going to close this as just by design. But I'm open to discussing the issue if there is an argument to be made.

@kbknapp kbknapp closed this as completed Oct 4, 2017
@marmistrz
Copy link
Author

Since it's subjective, what about making it configurable?

@kbknapp
Copy link
Member

kbknapp commented Oct 24, 2017

@marmistrz apologies I didn't get the ping that a comment was made!

In general I'm ok with making things configurable, and I'm not against adding a setting does exactly this. I'll re-open the issue but can't promise when it'll be done due to my work schedule lately. I'd be happy to help someone figure this out if they'd like to work on a fairly easy to implement issue.

@kbknapp kbknapp reopened this Oct 24, 2017
@kbknapp kbknapp added A-help Area: documentation, including docs.rs, readme, examples, etc... D: easy labels Oct 24, 2017
pierrechevalier83 added a commit to pierrechevalier83/clap-rs that referenced this issue May 28, 2018
That's in preparation of clap-rs#1013: provide option to layout the output
of "my_program --help" with the same alignment across sections.
pierrechevalier83 added a commit to pierrechevalier83/clap-rs that referenced this issue May 28, 2018
@kbknapp kbknapp closed this as completed Jul 22, 2018
pierrechevalier83 added a commit to pierrechevalier83/clap-rs that referenced this issue Aug 4, 2018
That's in preparation of clap-rs#1013: provide option to layout the output
of "my_program --help" with the same alignment across sections.
pierrechevalier83 added a commit to pierrechevalier83/clap-rs that referenced this issue Aug 4, 2018
pierrechevalier83 added a commit to pierrechevalier83/clap-rs that referenced this issue Aug 4, 2018
That's in preparation of clap-rs#1013: provide option to layout the output
of "my_program --help" with the same alignment across sections.
pierrechevalier83 added a commit to pierrechevalier83/clap-rs that referenced this issue Aug 4, 2018
pierrechevalier83 added a commit to pierrechevalier83/clap-rs that referenced this issue Sep 4, 2018
That's in preparation of clap-rs#1013: provide option to layout the output
of "my_program --help" with the same alignment across sections.
pierrechevalier83 added a commit to pierrechevalier83/clap-rs that referenced this issue Sep 4, 2018
pierrechevalier83 added a commit to pierrechevalier83/clap-rs that referenced this issue Jan 6, 2019
That's in preparation of clap-rs#1013: provide option to layout the output
of "my_program --help" with the same alignment across sections.
pierrechevalier83 added a commit to pierrechevalier83/clap-rs that referenced this issue Jan 6, 2019
@pksunkara pksunkara reopened this Feb 4, 2020
@pksunkara pksunkara removed the W: 2.x label Feb 4, 2020
@pksunkara pksunkara added this to the 3.1 milestone Feb 4, 2020
@pksunkara
Copy link
Member

@epage What do you think of this?

@epage
Copy link
Member

epage commented Oct 27, 2021

My general stance is to push back against configuration and prefer making a decision one way or the other :), depending on how hard the workarounds are, the number of people affected, etc.

For those unaware, my motivations for low configuration are:

  • Keep the API more focused. Its hard to find relevant parts of the API because the surface area is so large.
  • Keep the number of supported cases down (not number of flags but their permutations) since we've seen a lot of problems crop up from unexpected interactions
  • Keep the code base smaller / more nimble

We might be able to re-frame this to have it and keep low configuration, like with #2913 or #2914. We could keep the mainline clap behavior less configurable but allow people in the more corner cases to drop down to lower level APIs that offer them more flexibility to do what they want We can then keep on an eye on these (especially with crates.io's reverse dependencies) and use that as feedback for where we should take clap.

As for timelines, I wouldn't think this is a priority for 3.1. Putting it in my buckets (Focus Area, Planned, Someday), the prior conversation makes this seem like a Planned but my suggestion above makes this sound like a Someday or that it is Planned but blocked on #2913 and would then be targeted as a change to the lower level help generator only.

@pksunkara
Copy link
Member

My general stance is to push back against configuration and prefer making a decision one way or the other :), depending on how hard the workarounds are, the number of people affected, etc.

I guess that's where we differ. I envision clap (and clap had always been) to allow all kinds of configuration so that users can choose their own preferences.

Our job as maintainers is to grow the codebase to make sure those configuration options are not workarounds but rather modular and the number of people affected are less because they can opt-out.

In fact, I would wager that the reason clap is so popular is because of it's flexibility.

@epage epage added C-bug Category: Updating dependencies S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing and removed P4: nice to have labels Dec 8, 2021
@epage epage removed this from the 3.1 milestone Dec 9, 2021
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-bug Category: Updating dependencies S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing
Projects
None yet
Development

No branches or pull requests

4 participants