-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtestapp.bash.golden
More file actions
90 lines (84 loc) · 2.4 KB
/
Copy pathtestapp.bash.golden
File metadata and controls
90 lines (84 loc) · 2.4 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
#!/bin/bash
# testapp completion for bash
# Autogenerated by redant
testapp() {
local cur prev opts cmd
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
# Command stack tracking
local cmd_stack=()
local i=1
local found_cmd=false
# Build command stack
while [ $i -lt $COMP_CWORD ]; do
cmd="${COMP_WORDS[$i]}"
cmd_stack+=($cmd)
i=$((i+1))
done
# Handle completion based on command stack
case "${cmd_stack[@]}" in
"testapp")
# Completions for testapp
local opts="--help "
opts+='--config '
opts+='--help '
opts+='-h '
opts+='--list-commands '
opts+='--list-flags '
opts+='--list-format '
opts+='--output '
opts+='--raw-envelope '
opts+='--verbose '
opts+='-v '
local subcmds="completion hello project "
COMPREPLY=( $(compgen -W "$opts $subcmds" -- "$cur") )
;; "testapp completion")
# Completions for completion
local opts="--help "
opts+='--help '
opts+='-h '
opts+='--raw-envelope '
COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
;; "testapp hello")
# Completions for hello
local opts="--help "
opts+='--help '
opts+='-h '
opts+='--raw-envelope '
COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
;; "testapp project")
# Completions for project
local opts="--help "
opts+='--help '
opts+='-h '
opts+='--raw-envelope '
opts+='--all '
opts+='--namespace '
local subcmds="repo "
COMPREPLY=( $(compgen -W "$opts $subcmds" -- "$cur") )
;; "testapp project repo")
# Completions for repo
local opts="--help "
opts+='--help '
opts+='-h '
opts+='--raw-envelope '
opts+='--force '
opts+='--region '
local subcmds="create "
COMPREPLY=( $(compgen -W "$opts $subcmds" -- "$cur") )
;; "testapp project repo create")
# Completions for create
local opts="--help "
opts+='--help '
opts+='-h '
opts+='--raw-envelope '
opts+='--private '
opts+='--tags '
opts+='--template '
COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
;; *)
COMPREPLY=()
;;
esac
}
complete -F testapp testapp