3 ms·
I’m curious about your approach, did you have any resources or projects that you found yourself going back to? (Regarding shell completions in general)
by sbr464 7y ago
I’m curious about your approach, did you have any resources or projects that you found yourself going back to?
(Regarding shell completions in general)
- JoshMcguigan 7y agoThese [0] two [1] sections of the GNU Bash man pages were very useful. I also found that this tutorial [2] provided a useful perspective. I spent a small amount of time looking through the bash-completion [3] project as well as the git bash completions [4]. Generally, my process for writing is google around until I have some base level of knowledge, then building one or more demo applications to ensure my understanding is correct. Then as I'm writing the blog post I'll be refining the demo applications into examples for the blog post and/or library code that I want to open source. [0]: https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html#Programmable-Completion https://www.gnu.org/software/bash/manual/html_node/Programma... [1]: https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html#Programmable-Completion-Builtins https://www.gnu.org/software/bash/manual/html_node/Programma... [2]: https://hackaday.com/2018/01/19/linux-fu-custom-bash-command-completion/ https://hackaday.com/2018/01/19/linux-fu-custom-bash-command... [3]: https://github.com/scop/bash-completion https://github.com/scop/bash-completion [4]: https://github.com/git/git/blob/master/contrib/completion/git-completion.bash https://github.com/git/git/blob/master/contrib/completion/gi...
- sbr464 7y agoThanks for sharing (and @snowe2010)
- snowe2010 7y agoI've actually written two separate articles on shell completion, explicitly for subcommands, because the resources regarding subcommands is so lacking. https://tylerthrailkill.com/2019-01-13/writing-zsh-completion-scripts/ https://tylerthrailkill.com/2019-01-13/writing-zsh-completio... https://tylerthrailkill.com/2019-01-19/writing-bash-completion-script-with-subcommands/ https://tylerthrailkill.com/2019-01-19/writing-bash-completi... I need to improve them and write a bit more information, I was writing a library to generate completion scripts for both bash and zsh, so I had to know the differences quite well.