diff options
Diffstat (limited to 'compl/crypt.zsh')
| -rwxr-xr-x | compl/crypt.zsh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compl/crypt.zsh b/compl/crypt.zsh index 725c328..2e1e57a 100755 --- a/compl/crypt.zsh +++ b/compl/crypt.zsh @@ -1,11 +1,13 @@ #compdef crypt #autoload +# copy to /usr/share/zsh/site-functions/_crypt + _crypt() { local IFS=$'\n' local location - zstyle -s ":completion:${curcontext}:" location location || location="${CRYPT_LOCATION:-$HOME/.crypt}" - _values -C 'entries' ${$(find -L "$location" -name '*.gpg' -type f -print 2>/dev/null | sed -e "s#${location}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#g' -e 's#:#\\:#g' -e 's/\.\(pass\|otp\|txt\)/\[\1\]/' | sort):-""} + zstyle -s ":completion:${curcontext}:" location location || location="${CRYPT_PATH:-$HOME/.crypt}" + _values -C 'entries' ${$(crypt list --plain | sed -e "s#\([^[:space:]]*\)[[:space:]]*\(.*\)#\1\[\2\]#g" | sort):-""} } _crypt |
