Skip to content

Commit ea419e1

Browse files
committed
completion/vuejs: shellcheck
1 parent 261e8d7 commit ea419e1

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

clean_files.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ completion/available/travis.completion.bash
105105
completion/available/vault.completion.bash
106106
completion/available/virsh.completion.bash
107107
#completion/available/virtualbox.completion.bash
108-
#completion/available/vuejs.completion.bash
108+
completion/available/vuejs.completion.bash
109109
completion/available/wpscan.completion.bash
110110

111111
# libraries
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
# shellcheck shell=bash
22

3-
__vuejs_completion() {
4-
# shellcheck disable=SC2155
5-
local prev=$(_get_pword)
6-
# shellcheck disable=SC2155
7-
local curr=$(_get_cword)
3+
# Make sure vue is installed
4+
_bash-it-completion-helper-necessary vue || :
5+
6+
# Don't handle completion if it's already managed
7+
_bash-it-completion-helper-sufficient vue || return
8+
9+
function _vuejs() {
10+
local prev="${COMP_WORDS[COMP_CWORD - 1]}"
811

912
case $prev in
1013
create)
11-
# shellcheck disable=SC2207
12-
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"))
14+
COMPREPLY=("-p" "-d" "-i" "-m" "-r" "-g" "-n" "-f" "-c" "-x" "-b"
15+
"-h" "--help" "--preset" "--default" "--inilinePreset"
16+
"--packageManager" "--registry" "--git" "--no-git" "--force"
17+
"--merge" "--clone" "--proxy" "--bare" "" "--skipGetStarted")
1318
;;
1419
add | invoke)
15-
# shellcheck disable=SC2207
16-
COMPREPLY=($(compgen -W "--registry -h --help" -- "$curr"))
20+
COMPREPLY=("--registry" "-h" "--help")
1721
;;
1822
inspect)
19-
# shellcheck disable=SC2207
20-
COMPREPLY=($(compgen -W "-v --help --verbose --mode --rule --plugin --plugins --rules" -- "$curr"))
23+
COMPREPLY=("-v" "--help" "--verbose" "--mode" "--rule" "--plugin"
24+
"--plugins" "--rules")
2125
;;
2226
serve)
23-
# shellcheck disable=SC2207
24-
COMPREPLY=($(compgen -W "-o -h --help --open -c --copy -p --port" -- "$curr"))
27+
COMPREPLY=("-o" "-h" "--help" "--open" "-c" "--copy" "-p" "--port")
2528
;;
2629
build)
27-
# shellcheck disable=SC2207
28-
COMPREPLY=($(compgen -W "-t --target -n --name -d --dest -h --help" -- "$curr"))
30+
COMPREPLY=("-t" "--target" "-n" "--name" "-d" "--dest" "-h" "--help")
2931
;;
3032
ui)
31-
# shellcheck disable=SC2207
32-
COMPREPLY=($(compgen -W "-H --host -p --port -D --dev --quiet --headless -h --help" -- "$curr"))
33+
COMPREPLY=("-H" "--host" "-p" "--port" "-D" "--dev" "--quiet"
34+
"--headless" "-h" "--help")
3335
;;
3436
init)
35-
# shellcheck disable=SC2207
36-
COMPREPLY=($(compgen -W "-c --clone --offline -h --help" -- "$curr"))
37+
COMPREPLY=("-c" "--clone" "--offline" "-h" "--help")
3738
;;
3839
config)
39-
# shellcheck disable=SC2207
40-
COMPREPLY=($(compgen -W "-g --get -s --set -d --delete -e --edit --json -h --help" -- "$curr"))
40+
COMPREPLY=("-g" "--get" "-s" "--set" "-d" "--delete" "-e" "--edit"
41+
"--json" "-h" "--help")
4142
;;
4243
outdated)
43-
# shellcheck disable=SC2207
44-
COMPREPLY=($(compgen -W "--next -h --help" -- "$curr"))
44+
COMPREPLY=("--next" "-h" "--help")
4545
;;
4646
upgrade)
47-
# shellcheck disable=SC2207
48-
COMPREPLY=($(compgen -W "-t --to -f --from -r --registry --all --next -h --help" -- "$curr"))
47+
COMPREPLY=("-t" "--to" "-f" "--from" "-r" "--registry" "--all"
48+
"--next" "-h" "--help")
4949
;;
5050
migrate)
51-
# shellcheck disable=SC2207
52-
COMPREPLY=($(compgen -W "-f --from -h --help" -- "$curr"))
51+
COMPREPLY=("-f" "--from" "-h" "--help")
5352
;;
5453
*)
55-
# shellcheck disable=SC2207
56-
COMPREPLY=($(compgen -W "-h --help -v --version create add invoke inspect serve build ui init config outdated upgrade migrate info" -- "$curr"))
54+
COMPREPLY=("-h" "--help" "-v" "--version" "create" "add" "invoke"
55+
"inspect" "serve" "build" "ui" "init" "config" "outdated"
56+
"upgrade" "migrate" "info")
5757
;;
5858
esac
5959
}
6060

61-
complete -F __vuejs_completion vue
61+
complete -F _vuejs -X '!&*' vue

0 commit comments

Comments
 (0)