Reputation: 3781
I would like to auto-complete the arguments in my function foo
. I want to store a list of possible arguments like this: bar,baba,gugu
.
So when I type foo b[TAB]
in Terminal, I would like to have the recommendations of bar
and baba
.
Upvotes: 4
Views: 7748
Reputation: 3277
Here you go: http://freecode.com/projects/bashcompletion
You can install it via brew: brew install bash-completion
. During installation brew will say what to do next - add some lines to your ~/.bash_profile:
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
Take a look at README for instructions on how to add custom completions
Upvotes: 9