fixed and formatted laravel completion and used helper function

pull/1794/head
Gurkirat Singh 2021-01-10 19:30:08 +05:30 committed by Noah Gorny
parent 18781ed397
commit 59abc4fa9d
2 changed files with 8 additions and 12 deletions

View File

@ -53,6 +53,7 @@ completion/available/pipx.completion.bash
completion/available/rustup.completion.bash
completion/available/vault.completion.bash
completion/available/sdkman.completion.bash
completion/available/laravel.completion.bash
# aliases
#

View File

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