-
Notifications
You must be signed in to change notification settings - Fork 41
/
scrapple.sh
55 lines (45 loc) · 1.09 KB
/
scrapple.sh
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
51
52
53
54
55
_scrapple()
{
local cur
cur="${COMP_WORDS[COMP_CWORD]}"
if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W '-h --help -h --help -V --version run genconfig generate' -- $cur) )
else
case ${COMP_WORDS[1]} in
run)
_scrapple_run
;;
genconfig)
_scrapple_genconfig
;;
generate)
_scrapple_generate
;;
esac
fi
}
_scrapple_run()
{
local cur
cur="${COMP_WORDS[COMP_CWORD]}"
if [ $COMP_CWORD -ge 2 ]; then
COMPREPLY=( $( compgen -fW '-o= --output_type= -v= --verbosity= ' -- $cur) )
fi
}
_scrapple_genconfig()
{
local cur
cur="${COMP_WORDS[COMP_CWORD]}"
if [ $COMP_CWORD -ge 2 ]; then
COMPREPLY=( $( compgen -fW '-t= --type= -s= --selector= -l= --levels= ' -- $cur) )
fi
}
_scrapple_generate()
{
local cur
cur="${COMP_WORDS[COMP_CWORD]}"
if [ $COMP_CWORD -ge 2 ]; then
COMPREPLY=( $( compgen -fW '-o= --output_type= ' -- $cur) )
fi
}
complete -o bashdefault -o default -o filenames -F _scrapple scrapple