bash command completion for rake

Posted by Tim Connor Wed, 10 Oct 2007 03:29:00 GMT

I’ve written about improved bash completion in OS X before, but when setting up a iMac at my new job (more on that later), I couldn’t recall what I did for tab completion of rake tasks (which is really nice to have if you do much rails work). This time around, I just dropped Lee Marlow’s Rake Command Completion Using Rake into a scripts folder in my home directory, named it rake-completion.rb, and added


complete -C /Users/timconnor/scripts/rake-completion.rb -o default rake

into my .profile (or .bashrc or .bash_login, etc).

If you use one of the ruby completion scripts (like Lee’s) make sure not to drop it in your bash_completion auto-added folder (/opt/local/etc/bash_completion.d/) as that will choke, expecting a bash script, instead of a ruby one.

Leave a comment

Comments