fixed and formatted laravel completion and used helper function

pull/1782/head
Gurkirat Singh 2021-01-10 19:30:08 +05:30
parent 3ed0063fa6
commit c9e977d1c3
No known key found for this signature in database
GPG Key ID: CFD64E1DCB3DA835
1 changed files with 3 additions and 8 deletions

View File

@ -1,14 +1,9 @@
#!/usr/bin/bash #!/usr/bin/bash
if command -v laravel > /dev/null; then if _command_exists laravel; then
__laravel_completion() { __laravel_completion() {
local OPTS=("-h --help -q --quiet --ansi --no-ansi -n --no-interaction -v -vv -vvv --verbose help list new") local curr=$(_get_cword)
COMPREPLY=() COMPREPLY=($(compgen -W "list --raw --format -h --help -q --quiet -V --version --ansi --no-ansi -n --no-interaction -v -vv -vvv --verbose" -- "$curr"))
for _opt_ in ${OPTS[@]}; do
if [[ "$_opt_" == "$2"* ]]; then
COMPREPLY+=("$_opt_")
fi
done
} }
complete -F __laravel_completion laravel complete -F __laravel_completion laravel