-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path_yo
50 lines (39 loc) · 1.36 KB
/
_yo
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
41
42
43
44
45
46
47
48
49
50
#compdef yo
#autoload
# @description yo zsh completion
# @require 'yo' to be installed
# Location of this plugin
. "$__yeoman_pluginDir"/helpers_yo
local state line context
# $opt_args is an associative array that contains command-line options like -d or -f
# as its keys and the actual parameters to those options (if any) as its values
local -A opt_args
local -a arguments
arguments=(
"--help[Print this info and generator's options and usage]"
'-f[Overwrite files that already exist]'
'--force[Overwrite files that already exist]'
'--version[Print version]'
'--no-color[Disable colors]'
'--insight[Enable anonymous tracking]'
'--no-insight[Disable anonymous tracking]'
'--generators[Print available generators]'
'*:: :->generator'
)
# @description manage completion for first argument
# @param $1|$argLevel2 list of ${words[@]}
# @param $2|$cache File to store npm search results
# @return void
__yo_completeArgOne() {
local -a generator # available "downwards", i.e. in getGeneratorList()
case $state in
"generator")
__yo_getGeneratorList
_describe -t commands "command list" generator
;;
esac
ret=0 # tells compsys you successfully added some completions
}
_arguments -C $arguments
__yo_completeArgOne "$state" # manage completion for first argument
return $ret