-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcci.bash
More file actions
125 lines (110 loc) · 2.36 KB
/
cci.bash
File metadata and controls
125 lines (110 loc) · 2.36 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/usr/bin/env bash
# DESCRIPTION: Bash completion script for the Cumulus CLI
# AUTHOR: Todd Halfpenny (@toddhalfpenny)
# REPO: https://github.com/toddhalfpenny/cci-cli-bash-completion
# LICENSE: https://github.com/toddhalfpenny/cci-cli-bash-completion/blob/master/LICENSE
# Inspired by https://github.com/wadewegner/salesforce-cli-bash-completion
_cci()
{
local cur
local prev
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
prev2="${COMP_WORDS[COMP_CWORD-2]}"
local -a words=(
error \
flow \
org \
project \
service \
shell \
task \
version
)
local -a errorWords=(
gist \
info
)
local -a flowWords=(
info \
list \
run
)
local -a orgWords=(
browser \
connect \
default \
import \
info \
list \
remove \
scratch \
scratch_delete \
shell
)
local -a projectWords=(
dependencies \
info \
init
)
local -a serviceWords=(
connect \
info \
list
)
local -a serviceConnectWords=(
apextestsdb \
connected_app \
devhub \
github \
metaci \
metadeploy \
saucelabs \
)
local -a taskWords=(
doc \
info \
list \
run
)
case "$prev" in
cci)
COMPREPLY=( $(compgen -W "${words[*]}" -- $cur))
;;
error)
COMPREPLY=( $(compgen -W "${errorWords[*]}" -- $cur))
;;
flow)
COMPREPLY=( $(compgen -W "${flowWords[*]}" -- $cur))
;;
org)
COMPREPLY=( $(compgen -W "${orgWords[*]}" -- $cur))
;;
project)
COMPREPLY=( $(compgen -W "${projectWords[*]}" -- $cur))
;;
service)
COMPREPLY=( $(compgen -W "${serviceWords[*]}" -- $cur))
;;
connect)
case "$prev2" in
service)
COMPREPLY=( $(compgen -W "${serviceConnectWords[*]}" -- $cur))
;;
*)
# return to normal completion
COMPREPLY=()
;;
esac
;;
task)
COMPREPLY=( $(compgen -W "${taskWords[*]}" -- $cur))
;;
*)
# return to normal completion
COMPREPLY=()
;;
esac
return 0
}
complete -o default -F _cci cci