Merge pull request #1780 from tbhaxor/lint/vue-completions

Lint/vue completions
pull/1776/head
Noah Gorny 2021-01-26 20:03:34 +02:00 committed by GitHub
commit 4f8fd5957f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 57 additions and 46 deletions

View File

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

View File

@ -1,49 +1,59 @@
#!/usr/bin/bash # shellcheck shell=bash
if _command_exists vue; then __vuejs_completion() {
__vuejs_completion() { local prev=$(_get_pword)
local prev=$(_get_pword) local curr=$(_get_cword)
local curr=$(_get_cword)
case $prev in case $prev in
create) create)
COMPREPLY=($(compgen -W "-p -d -i -m -r -g -n -f -c -x -b -h --help --preset --default --inilinePreset --packageManager --registry --git --no-git --force --merge --clone --proxy --bare --skipGetStarted" -- "$curr")) # shellcheck disable=SC2207
;; COMPREPLY=($(compgen -W "-p -d -i -m -r -g -n -f -c -x -b -h --help --preset --default --inilinePreset --packageManager --registry --git --no-git --force --merge --clone --proxy --bare --skipGetStarted" -- "$curr"))
add|invoke) ;;
COMPREPLY=($(compgen -W "--registry -h --help" -- "$curr")) add | invoke)
;; # shellcheck disable=SC2207
inspect) COMPREPLY=($(compgen -W "--registry -h --help" -- "$curr"))
COMPREPLY=($(compgen -W "-v --help --verbose --mode --rule --plugin --plugins --rules" -- "$curr")) ;;
;; inspect)
serve) # shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-o -h --help --open -c --copy -p --port" -- "$curr")) COMPREPLY=($(compgen -W "-v --help --verbose --mode --rule --plugin --plugins --rules" -- "$curr"))
;; ;;
build) serve)
COMPREPLY=($(compgen -W "-t --target -n --name -d --dest -h --help" -- "$curr")) # shellcheck disable=SC2207
;; COMPREPLY=($(compgen -W "-o -h --help --open -c --copy -p --port" -- "$curr"))
ui) ;;
COMPREPLY=($(compgen -W "-H --host -p --port -D --dev --quiet --headless -h --help" -- "$curr")) build)
;; # shellcheck disable=SC2207
init) COMPREPLY=($(compgen -W "-t --target -n --name -d --dest -h --help" -- "$curr"))
COMPREPLY=($(compgen -W "-c --clone --offline -h --help" -- "$curr")) ;;
;; ui)
config) # shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-g --get -s --set -d --delete -e --edit --json -h --help" -- "$curr")) COMPREPLY=($(compgen -W "-H --host -p --port -D --dev --quiet --headless -h --help" -- "$curr"))
;; ;;
outdated) init)
COMPREPLY=($(compgen -W "--next -h --help" -- "$curr")) # shellcheck disable=SC2207
;; COMPREPLY=($(compgen -W "-c --clone --offline -h --help" -- "$curr"))
upgrade) ;;
COMPREPLY=($(compgen -W "-t --to -f --from -r --registry --all --next -h --help" -- "$curr")) config)
;; # shellcheck disable=SC2207
migrate) COMPREPLY=($(compgen -W "-g --get -s --set -d --delete -e --edit --json -h --help" -- "$curr"))
COMPREPLY=($(compgen -W "-f --from -h --help" -- "$curr")) ;;
;; outdated)
*) # shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-h --help -v --version create add invoke inspect serve build ui init config outdated upgrade migrate info" -- "$curr")) COMPREPLY=($(compgen -W "--next -h --help" -- "$curr"))
;; ;;
esac upgrade)
} # shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-t --to -f --from -r --registry --all --next -h --help" -- "$curr"))
;;
migrate)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-f --from -h --help" -- "$curr"))
;;
*)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-h --help -v --version create add invoke inspect serve build ui init config outdated upgrade migrate info" -- "$curr"))
;;
esac
}
complete -F __vuejs_completion vue complete -F __vuejs_completion vue
fi