[zsh] add scaleway cli autocompletion
This commit is contained in:
parent
d41b193e48
commit
a7ee0948d5
9
dot_zsh/scw-completion.zsh
Normal file
9
dot_zsh/scw-completion.zsh
Normal 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
|
||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user