---
 src/completion/pass.bash-completion | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/completion/pass.bash-completion 
b/src/completion/pass.bash-completion
index efd4b70..9157f2f 100644
--- a/src/completion/pass.bash-completion
+++ b/src/completion/pass.bash-completion
@@ -65,6 +65,19 @@ _pass()
        COMPREPLY=()
        local cur="${COMP_WORDS[COMP_CWORD]}"
        local commands="init ls find grep show insert generate edit rm mv cp 
git help version"
+       local fuzzycmd="${PASSWORD_STORE_FUZZY}"
+       local pwdir="${PASSWORD_STORE_DIR:-$HOME/.password-store/}"
+       local stringsize="${#pwdir}"
+       let "stringsize+=1"
+       trigger="**"
+
+       if [[ ${COMP_WORDS[COMP_CWORD]} == "$trigger" ]]; then
+               COMPREPLY=($(find "$pwdir" -name "*.gpg" | \
+               cut -c "$stringsize"- | sed -e 's/\(.*\)\.gpg/\1/' | \
+               "$fuzzycmd" | tr "\n" ' '))
+               return 0
+       fi
+
        if [[ $COMP_CWORD -gt 1 ]]; then
                local lastarg="${COMP_WORDS[$COMP_CWORD-1]}"
                case "${COMP_WORDS[1]}" in
-- 
2.1.4

_______________________________________________
Password-Store mailing list
[email protected]
http://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to