summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorTobias Preuss <tobias.preuss@googlemail.com>2013-04-26 11:02:18 +0200
committerTobias Preuss <tobias.preuss@googlemail.com>2013-06-27 02:02:07 +0200
commit10bd036dfe466d82f90f10edaa83dc67a90b8571 (patch)
tree7e3a3fd13c0362ff0eb8b6c24372eeea5cbccd84 /plugins
parentbc3cadf5c83697c176c9d4ce41c7fde7f57bf6e7 (diff)
downloadzsh-10bd036dfe466d82f90f10edaa83dc67a90b8571.tar.gz
zsh-10bd036dfe466d82f90f10edaa83dc67a90b8571.tar.bz2
zsh-10bd036dfe466d82f90f10edaa83dc67a90b8571.zip
Add autocompletion for Rails3.
+ Originally published by Christopher Chow. + Source: https://github.com/robbyrussell/oh-my-zsh/blob/30620d463850c17f86e7a56fbf6a8b5e793a4e07/plugins/rails3/_rails3 Commit: 30620d463850c17f86e7a56fbf6a8b5e793a4e07
Diffstat (limited to 'plugins')
-rw-r--r--plugins/rails3/_rails356
1 files changed, 56 insertions, 0 deletions
diff --git a/plugins/rails3/_rails3 b/plugins/rails3/_rails3
new file mode 100644
index 000000000..97915e68b
--- /dev/null
+++ b/plugins/rails3/_rails3
@@ -0,0 +1,56 @@
+#compdef rails
+#autoload
+
+# rails 3 zsh completion, based on homebrew completion
+# Extracted from https://github.com/robbyrussell/oh-my-zsh/blob/30620d463850c17f86e7a56fbf6a8b5e793a4e07/plugins/rails3/_rails3
+# Published by Christopher Chow
+
+local -a _1st_arguments
+_1st_arguments=(
+ 'generate:Generate new code (short-cut alias: "g")'
+ 'console:Start the Rails console (short-cut alias: "c")'
+ 'server:Start the Rails server (short-cut alias: "s")'
+ 'dbconsole:Start a console for the database specified in config/database.yml (short-cut alias: "db")'
+ 'new:Create a new Rails application. "rails new my_app" creates a new application called MyApp in "./my_app"'
+ 'application:Generate the Rails application code'
+ 'destroy:Undo code generated with "generate"'
+ 'benchmarker:See how fast a piece of code runs'
+ 'profiler:Get profile information from a piece of code'
+ 'plugin:Install a plugin'
+)
+
+_rails_generate_arguments() {
+ generate_arguments=(
+ controller
+ generator
+ helper
+ integration_test
+ mailer
+ migration
+ model
+ observer
+ performance_test
+ plugin
+ resource
+ scaffold
+ scaffold_controller
+ session_migration
+ stylesheets
+ )
+}
+
+_arguments \
+ '(--version)--version[show version]' \
+ '(--help)--help[show help]' \
+ '*:: :->subcmds' && return 0
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "rails subcommand" _1st_arguments
+ return
+fi
+
+case "$words[1]" in
+ generate)
+ _rails_generate_arguments
+ _wanted generate_arguments expl 'all generate' compadd -a generate_arguments ;;
+esac