Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1287 from johnhamelink/master

Laravel autocompletion
  • Loading branch information...
commit c27183abcd113da59c0d25c5324b7b7d15060f95 2 parents a0430a0 + b2c1af9
@robbyrussell authored
Showing with 43 additions and 0 deletions.
  1. +40 −0 plugins/laravel/_artisan
  2. +3 −0  plugins/laravel/laravel.plugin.zsh
View
40 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
View
3  plugins/laravel/laravel.plugin.zsh
@@ -0,0 +1,3 @@
+#!zsh
+alias artisan='php artisan'
+alias bob='php artisan bob::build'
Please sign in to comment.
Something went wrong with that request. Please try again.