Skip to content

Instantly share code, notes, and snippets.

@dasch
Created June 20, 2010 16:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dasch/445941 to your computer and use it in GitHub Desktop.
Save dasch/445941 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
comp_line = ENV["COMP_LINE"]
exit -1 if comp_line.nil?
COMMANDS = %w(server generate destroy plugin benchmarker profiler
console dbconsole application runner)
parts = comp_line.scan(/\w+/)
exit 0 unless parts.size == 2
prefix = parts[1]
puts COMMANDS.select {|cmd| cmd[0, prefix.length] == prefix }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment