From b2c1af91d3e70ea442ae5353cf7f140d89491c73 Mon Sep 17 00:00:00 2001 From: John Hamelink Date: Sun, 19 Aug 2012 14:03:23 +0100 Subject: [PATCH] Added laravel plugin which gives aliases to artisan and bob, and provides autocompletion for artisan. --- plugins/laravel/_artisan | 40 ++++++++++++++++++++++++++++++ plugins/laravel/laravel.plugin.zsh | 3 +++ 2 files changed, 43 insertions(+) create mode 100644 plugins/laravel/_artisan create mode 100644 plugins/laravel/laravel.plugin.zsh 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 +# +# 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'