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

Make visible_alias print in a way that fits convention #5459

Open
2 tasks done
lolbinarycat opened this issue Apr 15, 2024 · 4 comments
Open
2 tasks done

Make visible_alias print in a way that fits convention #5459

lolbinarycat opened this issue Apr 15, 2024 · 4 comments
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing

Comments

@lolbinarycat
Copy link

Please complete the following tasks

Clap Version

4.5.4

Describe your use case

print aliases in an easily understood way

Describe the solution you'd like

currently, aliases are printed at the end of the flag's description. i believe it would be much more natural to print them as -f, --flag, --alias description

Alternatives, if applicable

No response

Additional Context

No response

@lolbinarycat lolbinarycat added the C-enhancement Category: Raise on the bar on expectations label Apr 15, 2024
@epage epage added A-help Area: documentation, including docs.rs, readme, examples, etc... S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing labels Apr 16, 2024
@epage
Copy link
Member

epage commented Apr 16, 2024

Could you go into more detail on this as this is meant to be the jumping off point in the conversation.

For example

  • "print aliases in an easily understood way": It would help to show the current behavior and explain why it isn't easy to understand
  • "fits convention": while not in the issue body, it is in the title. What prior art have you seen for this? What are examples of that output? Is there prior art in other directions that you know of?

I assume you are somewhat connected with @tertsdiepraam who opened #5454. In that, concerns raised on the proposed output include

  • Alignment issues. While Change rendering of visible aliases to be more prominent #5454 had them misaligned, there are other approaches, each with their own trade offs, including
    • Indenting the block further: reducing the space for help text
    • Splitting it across lines, taking up more vertical space (could be limited to long-help). If the help is aligned with the first entry and overflows onto other lines, then it wouldn't take up more space.
  • Unclear association between flag and value though this already exists for short flags.
    • clap-help prints the short and long with their value

@tertsdiepraam
Copy link
Contributor

Nope, I don't know @lolbinarycat. But we could use this issue as it seems to he about the same thing. Thanks for the mention and I'll follow this issue.

@lolbinarycat
Copy link
Author

What prior art have you seen for this?

essentially every program that has aliases either prints them together, or prints them entirely separately, with the alias having a description like "alias for --some-other-flag"

for an example of the former see gnu tar (literally the first command i tried when you asked for an example)

@epage
Copy link
Member

epage commented Apr 16, 2024

I had tried three or so commands and couldn't find examples of aliases.

Its also good to get from a variety of design spaces to explore multiple options. If you could find more prior art, that would be helpful.

Relevant parts from tar --help

Sometimes they use next line help

  -w, --interactive, --confirmation
                             ask for confirmation for every action

Sometimes they affect alignment

  -A, --catenate, --concatenate   append tar files to an archive
  -c, --create               create a new archive
      --delete               delete from the archive (not on mag tapes!)
  -d, --diff, --compare      find differences between archive and file system
  -r, --append               append files to the end of an archive
      --test-label           test the archive volume label and exit
  -t, --list                 list the contents of an archive
  -u, --update               only append files newer than copy in archive
  -x, --extract, --get       extract files from an archive

When they take a value, they don't list the value for the short but they do for each long

  -F, --info-script=NAME, --new-volume-script=NAME
                             run script at end of each tape (implies -M)

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 S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing
Projects
None yet
Development

No branches or pull requests

3 participants