clap-rs / clap

A full featured, fast Command Line Argument Parser for Rust
docs.rs/clap
Apache License 2.0
13.65k stars 1.02k forks source link

Change rendering of visible aliases to be more prominent #5454

Open tertsdiepraam opened 2 months ago

tertsdiepraam commented 2 months ago

Hi! We got an issue on the coreutils (https://github.com/uutils/coreutils/issues/6223) about visible aliases not being prominent enough. This is an attempt at fixing that. I'm opening a PR directly instead of opening an issue because I wanted to see what it would look like, but I can move the discussion to an issue if you want. CI will also fail on this, because I haven't adapted the tests yet.

In short, the help output with this change looks like this:

Options:
  -m, -a, --manifest-path, --blabla <PATH>  
  -h, --help                  Print help
  -V, --version               Print version

Instead of the [short aliases: ...] and [aliases: ...]. However, I would be happy to try other formats if you prefer. With this format the help output gets misaligned. I haven't looked into that yet and would first like to discuss whether you would even accept this change.

Another issue is that the argument might need to be duplicated. In the example above, it looks like only --blabla takes an argument and --manifest-path does not.

If you don't want this as default behaviour, I could also make it optional.

Let me know what you think :)

epage commented 2 months ago

Please open an issue for discussing this. I've adopted a pretty strict "problem/solutions are discussed in issues, implementation is discussed in PRs" stance after seeing PRs go on for too long, a conversation split across multiple PRs, and as a personal boundary as there is social pressure to move PRs along towards being merged.

tertsdiepraam commented 2 months ago

Apologies, will do that soon!