Re:Creating a bash completion script (2018)
by pastage on Wednesday March 02, 2022 @06:42AM
(#30526209)
Great that someone is thinking about this, doesn't seem very usefull though, it requires MacOS. But the bash one has been there since the beginning, so you are comparing a project that seems to be created in 2021 without any need for backward compatibilty with one that has grown organically for 15 years.
Re:Creating a bash completion script (2018)
by nrclark on Wednesday March 02, 2022 @11:13AM
(#30528935)
It doesn't have to be pure shell. I've written a few tools that have built-in completion helpers. All their completion scripts have to do is run the tool with the right environment variables, and return the results.
That's also how autocompletion works with Python's excellent Click library.
As a point of comparison, see the difference between the git completions written in bash [1] vs the declarative equivalent [2].
[1] https://github.com/git/git/blob/master/contrib/completion/gi...
[2] https://github.com/withfig/autocomplete/blob/master/src/git....