Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: hide flag completions by default #19

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Aug 21, 2024

The vast majority of shell completion scripts hide flag completions by default, only showing them if the current word starts with a -.
For example, all the fish completion scripts that ship with the shell itself do this, as do the git completions for zsh.

Additionally, in some shells, completion results are also shown in an order where flags starting with -- are always displayed first, which is reasonably annoying.

Thanks to maf for picking up on this!

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ethanndickson and the rest of your teammates on Graphite Graphite

@ethanndickson ethanndickson marked this pull request as ready for review August 21, 2024 11:42
@ethanndickson ethanndickson requested a review from ammario August 21, 2024 11:44
Copy link
Member

@ammario ammario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good stuff

isSlice {
allResps = append(allResps, "--"+opt.Flag)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to minimize indentation — use an early return instead of the else block

@ethanndickson ethanndickson requested a review from ammario August 22, 2024 02:49
@ethanndickson ethanndickson merged commit 1b2301f into main Aug 22, 2024
2 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants