[zsh] add scaleway cli autocompletion

This commit is contained in:
Julien Rabier 2020-07-22 10:44:38 +02:00
parent d41b193e48
commit a7ee0948d5
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,9 @@
_scw () {
output=($(scw autocomplete complete zsh -- ${CURRENT} ${words}))
opts=('-S' ' ')
if [[ $output == *= ]]; then
opts=('-S' '')
fi
compadd "${opts[@]}" -- "${output[@]}"
}
compdef _scw scw

View File

@ -40,6 +40,7 @@ source ~/.zsh/functions
source ~/.zsh/exports source ~/.zsh/exports
source ~/.zsh/dstask-completion.zsh source ~/.zsh/dstask-completion.zsh
source ~/.zsh/fzf-completion.zsh source ~/.zsh/fzf-completion.zsh
source ~/.zsh/scw-completion.zsh
{{- if eq .chezmoi.hostname "taupo" }} {{- if eq .chezmoi.hostname "taupo" }}
source ~/.zsh/aliases_taupo source ~/.zsh/aliases_taupo