Skip to content

Commit f299425

Browse files
authored
Add bash completion for exec (#579)
1 parent 0266f58 commit f299425

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

completions/bash/aws-gate

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
__aws_gate_complete_commands() {
44
local commands="
55
bootstrap
6+
exec
67
list ls
78
session
89
ssh
@@ -96,6 +97,28 @@ __aws_gate_complete_list() {
9697
esac
9798
}
9899

100+
__aws_gate_complete_exec() {
101+
case "${prev}" in
102+
-p|--profile)
103+
__aws_gate_complete_opt_profile
104+
;;
105+
-r|--region)
106+
__aws_gate_complete_opt_region
107+
;;
108+
*)
109+
local args="
110+
-h --help
111+
-p --profile
112+
-r --region
113+
"
114+
115+
__aws_gate_merge_hosts_to_args
116+
117+
COMPREPLY=( $(compgen -W "${args}" -- "${cur}") )
118+
;;
119+
esac
120+
}
121+
99122
__aws_gate_complete_opt_profile() {
100123
local aws_profiles="
101124
$(grep '\[' ~/.aws/credentials | grep -v '#' | tr -d '[' | tr -d ']')
@@ -210,6 +233,9 @@ __aws_gate_complete() {
210233
bootstrap)
211234
__aws_gate_complete_bootstrap
212235
;;
236+
exec)
237+
__aws_gate_complete_exec
238+
;;
213239
session)
214240
__aws_gate_complete_session
215241
;;

0 commit comments

Comments
 (0)