summaryrefslogtreecommitdiff
path: root/plugins/laravel
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2012-09-01 08:31:52 -0700
committerRobby Russell <robby@planetargon.com>2012-09-01 08:31:52 -0700
commitc27183abcd113da59c0d25c5324b7b7d15060f95 (patch)
tree451e0532bf011f770685ef3eeb47afcd936bd174 /plugins/laravel
parenta0430a0a45f81ecff5682070647f9c4c2da6410f (diff)
parentb2c1af91d3e70ea442ae5353cf7f140d89491c73 (diff)
downloadzsh-c27183abcd113da59c0d25c5324b7b7d15060f95.tar.gz
zsh-c27183abcd113da59c0d25c5324b7b7d15060f95.tar.bz2
zsh-c27183abcd113da59c0d25c5324b7b7d15060f95.zip
Merge pull request #1287 from johnhamelink/master
Laravel autocompletion
Diffstat (limited to 'plugins/laravel')
-rw-r--r--plugins/laravel/_artisan40
-rw-r--r--plugins/laravel/laravel.plugin.zsh3
2 files changed, 43 insertions, 0 deletions
diff --git a/plugins/laravel/_artisan b/plugins/laravel/_artisan
new file mode 100644
index 000000000..8637514cf
--- /dev/null
+++ b/plugins/laravel/_artisan
@@ -0,0 +1,40 @@
+#compdef artisan
+
+# Laravel autocompletion
+# Author: John Hamelink <john@johnhamelink.com>
+#
+# This plugin does the following:
+# - Adds aliases and autocompletion for artisan
+# - Adds aliases and autocompletion for bob
+
+local curcontext="$curcontext" state line _opts _bundles ret=1
+_arguments -C \
+ '1: :->cmds' \
+ '*:: :->args' && ret=0
+
+case $state in
+ cmds)
+
+ _values "Artisan command" \
+ 'session\:install[Create a session table]' \
+ 'migrate[Manage Migrations]' \
+ 'test[Run a test]' \
+ 'route\:\:call[Call a route in the CLI]' \
+ 'key\:\:generate[Generate a key]'
+ ret=0
+ ;;
+ args)
+ case $line[1] in
+ migrate)
+ _values \
+ 'install[Create the Laravel migration table' \
+ 'make[Create a migration]' \
+ 'rollback[Roll back to the last migration operation]' \
+ 'reset[Roll back all migrations that have ever run]'
+ ret=0
+ ;;
+ esac
+ ;;
+esac
+
+return ret
diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh
new file mode 100644
index 000000000..ed932ee89
--- /dev/null
+++ b/plugins/laravel/laravel.plugin.zsh
@@ -0,0 +1,3 @@
+#!zsh
+alias artisan='php artisan'
+alias bob='php artisan bob::build'