Bash completion for Rake tasks

I have a poor memory, especially for things a computer should do for me. Frustrated with Rake commands (is it logs:clear or log:clear?) I turned to Bash completion. A web search found this basic implementation. Because it called rake -T on each invocation, it was unusably slow. Another search found Jonathan Palardy’s implementation with caching. Nice.

I worked on it a little more to be able to add it to Homebrew’s bash-completion package. Though it turns out that Homebrew’s package just grabs from the main bash-completion distribution so I’ll have to see about adding it there.

In any case, here in all its glory, a bash-completion for Rake. It caches automatically so all but the first use is fast. It also checks for a tmp/cache directory (present in Rails projects) and places the cache in there if available. This saves you from having to add the .rake_t_cache file to your SCM’s ignore list.

This entry was posted in Coding. Bookmark the permalink. Both comments and trackbacks are currently closed.
  • Subscribe

    Subscribe to all posts by feed.
  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 3 other subscribers