-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.autocompletions
45 lines (34 loc) · 1.02 KB
/
.autocompletions
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
# Activate autocomplete for zsh
autoload -U compinit && compinit
# Kubectl
source <(kubectl completion zsh)
complete -F __start_kubectl kc
# Helm
source <(helm completion zsh)
# Rclone
#source <(rclone completion zsh)
# Argocd
compdef _argocd argocd
source <(argocd completion zsh)
# Stern
# Haven't gotten this to work yet
#compdef _stern stern
#source <(stern --completion=zsh)
# Kgsec autocomplete function
_kgsec() {
# Get list of secret names using kubectl
local secrets=$(kubectl get secrets -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}')
# Parse secret names and set completions
local completions=("${(@f)secrets}")
_arguments '*:secret name:_values -s "," "${completions[@]}"'
}
# Register completion function for kgsec
compdef _kgsec kgsec
# Minio Client
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /usr/local/bin/mc mc
# AWS cli
complete -C '/usr/local/bin/aws_completer' aws
export PATH=/usr/local/aws/bin:$PATH
# Azure cli
source /opt/homebrew/etc/bash_completion.d/az