Open Albonycal opened 3 years ago
I would suggest leveraging the existing cobra framework for using completions. https://github.com/spf13/cobra/blob/master/shell_completions.md
This would then allow for baking the completion into the binary itself so people can just run kr completion zsh >> ~/.zshrc
Hmm.. Interesting.. ok
You should be able to generate the completions by using cobra along the lines of
cd cmd/kiterunner
cobra add completions
I think. I haven't had a chance to try yet, but this might have the desired effect of generating autocompletion for all commands.
Additional work would be annotating specific flags with better autocompletion hints, like the output flag https://github.com/spf13/cobra/blob/master/shell_completions.md#specify-dynamic-flag-completion
This adds auto completion for zsh & bash... How should we implement this? Like We can add just a couple lines to the Readme for bash or zsh completions, But how will this be implemented on pre-compiled binaries? Include the completion files with the archive? Thank you :)