forked from bash-my-aws/bash-my-aws
-
Notifications
You must be signed in to change notification settings - Fork 2
/
bash_completion.sh
100 lines (91 loc) · 3.35 KB
/
bash_completion.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
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
_bma_elbs_completion() {
local command="$1"
local word="$2"
local options=$(elbs)
COMPREPLY=($(compgen -W "${options}" -- ${word}))
return 0
}
_bma_stacks_completion() {
local command="$1"
local word="$2"
case "${COMP_CWORD}" in
1)
COMPREPLY=( $(compgen -W "$(stacks)" -- ${word}) )
return 0
;;
*)
COMPREPLY=( $(compgen -f ${word}) )
return 0
;;
esac
}
_bma_instances_completion() {
local command="$1"
local word="$2"
case $word in
"") options="i-a i-b" ;;
*) options=$(instances) ;;
esac
COMPREPLY=($(compgen -W "${options}" -- ${word}))
return 0
}
_bma_asgs_completion() {
local command="$1"
local word="$2"
local options=$(asgs --query 'AutoScalingGroups[][{"AutoScalingGroupName": AutoScalingGroupName}][]')
COMPREPLY=($(compgen -W "${options}" -- ${word}))
return 0
}
_bma_multipass_completion() {
local command="$1"
local word="$2"
local options="$(ls $BMA_MULTIPASS_DIR)"
COMPREPLY=($(compgen -W "${options}" -- ${word}))
}
complete -F _bma_multipass_completion multipass-edit
complete -F _bma_multipass_completion multipass-use
complete -F _bma_instances_completion instances
complete -F _bma_instances_completion instance-asg
complete -F _bma_instances_completion instance-az
complete -F _bma_instances_completion instance-console
complete -F _bma_instances_completion instance-dns
complete -F _bma_instances_completion instance-iam-profile
complete -F _bma_instances_completion instance-ip
complete -F _bma_instances_completion instance-ssh
complete -F _bma_instances_completion instance-ssh-details
complete -F _bma_instances_completion instance-stack
complete -F _bma_instances_completion instance-start
complete -F _bma_instances_completion instance-state
complete -F _bma_instances_completion instance-stop
complete -F _bma_instances_completion instance-tags
complete -F _bma_instances_completion instance-terminate
complete -F _bma_instances_completion instance-type
complete -F _bma_instances_completion instance-userdata
complete -F _bma_instances_completion instance-volumes
complete -F _bma_instances_completion instance-vpc
complete -F _bma_asgs_completion asgs
complete -F _bma_asgs_completion asg-capacity
complete -F _bma_asgs_completion asg-instances
complete -F _bma_asgs_completion asg-processes_suspended
complete -F _bma_asgs_completion asg-resume
complete -F _bma_asgs_completion asg-suspend
complete -F _bma_asgs_completion asg-scaling-activities
complete -F _bma_stacks_completion stacks
complete -F _bma_stacks_completion stack-cancel-update
complete -F _bma_stacks_completion stack-update
complete -F _bma_stacks_completion stack-delete
complete -F _bma_stacks_completion stack-recreate
complete -F _bma_stacks_completion stack-failure
complete -F _bma_stacks_completion stack-events
complete -F _bma_stacks_completion stack-resources
complete -F _bma_stacks_completion stack-asgs
complete -F _bma_stacks_completion stack-elbs
complete -F _bma_stacks_completion stack-instances
complete -F _bma_stacks_completion stack-parameters
complete -F _bma_stacks_completion stack-status
complete -F _bma_stacks_completion stack-tail
complete -F _bma_stacks_completion stack-template
complete -F _bma_stacks_completion stack-outputs
complete -F _bma_stacks_completion stack-diff
complete -F _bma_elbs_completion elb-instances
complete -f stack-validate