Skip to content

Instantly share code, notes, and snippets.

@arandilopez
Last active November 23, 2017 00:03
Show Gist options
  • Save arandilopez/959fd298e2742e322ff68001687f80ec to your computer and use it in GitHub Desktop.
Save arandilopez/959fd298e2742e322ff68001687f80ec to your computer and use it in GitHub Desktop.
Add zsh completion to laravel artisan comands
# Laravel 5 basic command completion
_laravel5_get_command_list () {
php artisan --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z]+/ { print $1 }'
}
_artisan () {
if [ -f artisan ]; then
compadd `_laravel5_get_command_list`
fi
}
compdef _artisan artisan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment