Re:Creating a bash completion script (2018)
by mieubrisse on Wednesday March 02, 2022 @08:12AM
(#30526940)
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)
[ Parent
| on HN ]
Re:Creating a bash completion script (2018)
by kortex on Wednesday March 02, 2022 @09:47AM
(#30527894)
I 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.