This commit is contained in:
nervo 2026-01-20 05:16:47 -03:00 committed by GitHub
commit c82b620f77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 0 deletions

9
plugins/sops/README.md Normal file
View file

@ -0,0 +1,9 @@
## Sops
This plugin adds completion for [sops](https://github.com/scaleway/scaleway-cli), the simple and flexible tool for managing secrets.
To use it, add `sops` to the plugins array in your zshrc file:
```zsh
plugins=(... sops)
```

View file

@ -0,0 +1,23 @@
# Completion
if (( ! $+commands[sops] )); then
return
fi
_sops() {
local -a opts
local cur
cur=${words[-1]}
if [[ "$cur" == "-"* ]]; then
opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-shell-completion)}")
else
opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-shell-completion)}")
fi
if [[ "${opts[1]}" != "" ]]; then
_describe 'values' opts
else
_files
fi
}
compdef _sops sops