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

fix(help): Don't show hidden arguments in groups #5855

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

julian-klode
Copy link

This should be pretty obvious, hidden arguments are shown in groups, but should be hidden

@julian-klode
Copy link
Author

Looking for |-- it seems there's no test cases for argument group rendering in the usage but hints welcome (or someone pushing tests, I'm chasing down various rabbit holes 🤣 )

@epage
Copy link
Member

epage commented Feb 18, 2025

Thank you for your patience! I'm getting some time to catch up with my notifications from the US holidays.

Looking for |-- it seems there's no test cases for argument group rendering in the usage but hints welcome (or someone pushing tests, I'm chasing down various rabbit holes 🤣 )

I'm seeing several tests that show the result of format_group:

tests/builder/flag_subcommands.rs
502:Usage: pacman {query|--query|-Q} [OPTIONS]
550:Usage: pacman {query|--query} [OPTIONS]

tests/builder/help.rs
2696:Usage: deno <pos1|--option1> [pos2]

tests/builder/groups.rs
135:  <base|--delete>
137:Usage: clap-test <base|--delete>
162:Usage: clap-test <base|--delete>
192:Usage: clap-test <--all|--delete>
328:  <--in|--spec>
330:Usage: prog --config <--in|--spec>

tests/builder/require.rs
992:Usage: clap-test --opt=<FILE> --foo=<FILE> <--g1=<FILE>|--g2=<FILE>>
1475:Usage: test --require-first <--first|--second>

tests/derive/groups.rs
49:  <CRATES|--path <PATH>|--git <GIT>>
51:Usage: prog --add <CRATES|--path <PATH>|--git <GIT>>
234:  <--path <PATH>|--git <GIT>>
236:Usage: test <--path <PATH>|--git <GIT>>

It would be a big help if you could organize your PR where the commits are

  1. Add a test, showing the current behavior (ie it passes)
  2. Make the behavior change and update the test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants