diff options
author | Marc CornellĂ <marc.cornella@live.com> | 2019-05-08 20:40:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-08 20:40:36 +0200 |
commit | 0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534 (patch) | |
tree | 946d9f8b758ebdd63da96152ca56b154c99068da /plugins/pass/_pass | |
parent | afb028763cf40fc339e49011b2cba124dc108fcb (diff) | |
parent | ebc700be9b2fa7ae770a644093a5c46a8e323726 (diff) | |
download | zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.gz zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.bz2 zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.zip |
Merge branch 'master' into master
Diffstat (limited to 'plugins/pass/_pass')
-rw-r--r-- | plugins/pass/_pass | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/pass/_pass b/plugins/pass/_pass index 7a9b1f955..5f3b8f541 100644 --- a/plugins/pass/_pass +++ b/plugins/pass/_pass @@ -6,11 +6,17 @@ # Brian Mattern <rephorm@rephorm.com> # Jason A. Donenfeld <Jason@zx2c4.com>. # All Rights Reserved. -# # This file is licensed under the GPLv2+. -# Please visit http://git.zx2c4.com/password-store/tree/COPYING for more information. +# Please visit https://git.zx2c4.com/password-store/tree/COPYING for more information. + + +# If you use multiple repositories, you can configure completion like this: # -# Oh my zsh plugin maintainer: Santiago Borrazás <sanbor@gmail.com> +# compdef _pass workpass +# zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass" +# workpass() { +# PASSWORD_STORE_DIR=$HOME/work/pass pass $@ +# } _pass () { @@ -117,8 +123,9 @@ _pass_cmd_show () { } _pass_complete_entries_helper () { local IFS=$'\n' - local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort):-""} + local prefix + zstyle -s ":completion:${curcontext}:" prefix prefix || prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" + _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#' | sort):-""} } _pass_complete_entries_with_subdirs () { |