[pass] [PATCH 3/5] skip directories in zsh completion

Brian Mattern rephorm at rephorm.com
Thu Sep 13 07:24:27 CEST 2012


this allows the full entry to be completed with a single tab if there is
only one entry in a folder

e.g., given:

 amazon.com
=C2=A0=C2=A0  user at domain.com
 google.com
=C2=A0=C2=A0  user1
=C2=A0=C2=A0  user2

`pass am<tab>` -> `pass amazon.com/user at domain.com`

while

`pass goo<tab>` -> `pass google.com/`

(previously, the amazon completion would have stopped at amazon.com
despite only a single entry existing)
---
 contrib/pass.zsh-completion |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/pass.zsh-completion b/contrib/pass.zsh-completion
index 67ed2f3..e0aa7e9 100644
--- a/contrib/pass.zsh-completion
+++ b/contrib/pass.zsh-completion
@@ -69,5 +69,5 @@ _pass_cmd_rm () {
 }
=20
 _get_stored_pwd () {
-  compadd `find ~/.password-store \( -name .git -o -name .gpg-id \) -prune=
 -o -print | sed 's#.*\.password-store*.##'| sed 's#\.gpg##' | sort`
+  compadd `find ~/.password-store \( -name .git -o -name .gpg-id \) -prune=
 -o -type f -print | sed 's#.*\.password-store*.##'| sed 's#\.gpg##' | sort`
 }
--=20
1.7.9.5





More information about the Password-Store mailing list