summaryrefslogtreecommitdiffstats
path: root/zsh/oh-my-zsh/plugins/laravel/_artisan
blob: 8637514cfe97ccf0ce40d208b46c68ebbb8f86bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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