4 ms·
For folks writing a Go CLI, the Cobra library (used by the kubectl and docker CLIs) comes with completions for bash, zsh, and fish out of the box. Completion sc
by mieubrisse 5y ago
For folks writing a Go CLI, the Cobra library (used by the kubectl and docker CLIs) comes with completions for bash, zsh, and fish out of the box. Completion scripts are indeed a hairy mess (see the instructions for installing Bash completions on kubectl!) and we were very pleasantly surprised at how trivial Cobra made it. (I've no affiliation with Cobra; just a very happy user)
- kortex 5y agoI use Cleo for python, same thing, has the ability to generate completion scripts. I also find the API far saner than argparse or click. I don't really use the docstring-parser, I prefer using the Command api for finer control, but it's really cool to just write the help docs and automagically get options. https://github.com/sdispater/cleo https://github.com/sdispater/cleo
- jakupovic 5y agoCobra is awesome. Was surprised the same at how easy it was to add completion support. Here is +1 from this satisfied end user, no affiliation with cobra team.