News for hackers. Stuff that matters.
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)
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.

https://github.com/sdispater/cleo

Re:Creating a bash completion script (2018) by jakupovic on Wednesday March 02, 2022 @10:38AM (#30528502)
Cobra 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.