I found out today that it’s possible to autocomplete rake tasks in bash. All
that’s needed is a simple ruby script and some changes to your ~/.profile
.
(Original information taken from a tumble blog post)
First you need to grab a script called ruby-completion.rb, which I’ve already added to my github dotfiles repository.
Then, as per the script comments, add the following to your ~/.profile
or
~/.bashrc
:
complete -C /path/to/rake-completion.rb -o default rake
Make sure that the script has execute permissions (chmod u+x
ruby-completion.sh
) or it will return some strange results when you hit
tab