bash-completion-tutorial
bash-completion-tutorial copied to clipboard
Code of the bash completion tutorial
((Thanks, https://iridakos.com/programming/2018/03/01/bash-programmable-completion-tutorial Is super-accessible, and very helpful!)) From this place in your doc > replace tabs with spaces ... > sed to the rescue. > ... fc -l -50 |...
When working through the tutorial, once you begin using fc -l... in the completion script. You neglect to add the IFS=$'\n' to the script. This results in each command and...
My setting in ``~/.inputrc`` ``` set show-all-if-ambiguous on #cycle through choices with ctrl-right/left "\e[1;5C": menu-complete "\e[1;5D": menu-complete-backward ``` When triggering ``menu-complete`` (see ``man bash``) first word takes place (in not...
Hello, if I could autocomplete the param using fuzzy match? ``` params hello world $ comp_test ld world ```
Your code relies on word splitting `suggestions=( $(compgen ... ) )` and the completion gives me wrong results before you set `IFS=$'\n'`. When you tested your function, you might have...
Ok, I read about it a bit now and I understand: https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash It's there to signify we've finished listing the options and will now only add the prefix of the...
Thanks for the guide, I'm really grateful. But could I suggest to you to change the dummy script to something maybe less potential harmful, for example: ```shell if [ -z...