-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
cli: extend flags completion #5343
Comments
I prepared this integration by improving the documentation of an existing method https://pkg.go.dev/github.com/spf13/cobra@master#FixedCompletions There is no need for latest cobra code to be tagged and used. I only worked on the documentation, that was a bit unclear |
For the v2, I will change the linters management and the configuration, so unless you are not changing any existing code, I would prefer to not implement this for now. |
OK. Thanks for the feedback. I could open PRs for adding completion to flags where it's about adding a few lines of code per command. And the ones that might require a refactoring could be left aside. I think this small changes could bring a nice feature. EDIT: I put my suggestion on hold now, I've seen the v2 refactoring suggested here |
Quick follow-up: I worked to add type and method to improve the way to use completion |
Welcome
Your feature request related to a problem? Please describe
I would like to be able to complete the flag values such as
--out-format=git<TAB>
or--enable-only=use<TAB>
Right now, only the flags are completed, not their values
Describe the solution you'd like
The tool uses cobra, we could use
https://pkg.go.dev/github.com/spf13/cobra#Command.RegisterFlagCompletionFunc
Describe alternatives you've considered
Define my own completions locally 😅
Additional context
I took a look at the code, most flag will be "easy"
Some might require a small refactoring because of the helpers defined in the code
Supporter
The text was updated successfully, but these errors were encountered: