Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel autocompletion #1287

Merged
merged 1 commit into from
Sep 1, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions plugins/laravel/_artisan
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions plugins/laravel/laravel.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!zsh
alias artisan='php artisan'
alias bob='php artisan bob::build'