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

Support hiding flags/subcommands/possible values/aliases for native compeletions #3951

Closed
epage opened this issue Jul 19, 2022 · 5 comments
Closed
Labels
A-completion Area: completion generator C-enhancement Category: Raise on the bar on expectations E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. 💸 $20

Comments

@epage
Copy link
Member

epage commented Jul 19, 2022

We shouldn't offer hidden options by default but complete them if the user starts typing them

See #3166 for more details on native completions

@shannmu
Copy link
Contributor

shannmu commented Jun 21, 2024

i will work on this later.

@epage epage changed the title Support hiding flags/subcommands/possible values for native compeletions Support hiding flags/subcommands/possible values/aliases for native compeletions Jun 21, 2024
@epage
Copy link
Member Author

epage commented Jun 21, 2024

Before we do this:

  • We should make sure subcommand visible aliases are supported

In doing this, we should hide hidden items by default unless there are no other completions available.

@epage
Copy link
Member Author

epage commented Jun 21, 2024

PR #5283 started work on this but it seemed to have stalled out

Per usual, I would like to see

  • Tests added / updated in one commit, showing current behavior
  • As features are implemented, update the tests so they show the new behavior and the diff shows the change in behavior

see also my comment from that PR:

There is one point I wasn't clear about in the expectations for this: we should probably keep a completion hidden unless there are no visible choices.

In reviewing this, I also noticed

  • I didn't mention hidden aliases

  • We aren't showing visible subcommand aliases

I do find it less than ideal how inconsistent we are with where we check is_hide_set. However, I assume cleaning that up would naturally fall out of the above as we'd need to start returning (value, is_hidden, help) (maybe turned into a struct? if so, ideally that refactor would be its own commit) so we can handle all of these cases.

@epage
Copy link
Member Author

epage commented Jul 5, 2024

Something @shannmu called out is our idea for showing hidden content is only if the user started it, we'll never be able to show hidden short flags or hidden short flag aliases. We'll still need to make sure we can complete values for them.

@epage
Copy link
Member Author

epage commented Jul 19, 2024

@shannmu I went ahead and merged #5585 because it was complete-enough on its own but we still lack support for completing hidden aliases for PossibleValue.

I'll make #5480 responsible for supporting visible aliases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion Area: completion generator C-enhancement Category: Raise on the bar on expectations E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. 💸 $20
Projects
None yet
2 participants