f2f078a1bbbce1631a99150029541544e621b6be
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
pass: update completion (2018-08-03)
Diff
1diff --git a/plugins/pass/_pass b/plugins/pass/_pass
2index 715229e76fcd3e326c3d65d80e282c2a59c46ae1..5f3b8f541cc3d5e5383d59d42add2f788dc219a0 100644
3--- a/plugins/pass/_pass
4+++ b/plugins/pass/_pass
5@@ -6,11 +6,17 @@
6 # Brian Mattern <rephorm@rephorm.com>
7 # Jason A. Donenfeld <Jason@zx2c4.com>.
8 # All Rights Reserved.
9-#
10 # This file is licensed under the GPLv2+.
11 # Please visit https://git.zx2c4.com/password-store/tree/COPYING for more information.
12+
13+
14+# If you use multiple repositories, you can configure completion like this:
15 #
16-# Oh my zsh plugin maintainer: Santiago Borrazás <sanbor@gmail.com>
17+# compdef _pass workpass
18+# zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass"
19+# workpass() {
20+# PASSWORD_STORE_DIR=$HOME/work/pass pass $@
21+# }
22
23
24 _pass () {
25@@ -117,8 +123,9 @@ _pass_cmd_show () {
26 }
27 _pass_complete_entries_helper () {
28 local IFS=$'\n'
29- local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
30- _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):-""}
31+ local prefix
32+ zstyle -s ":completion:${curcontext}:" prefix prefix || prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
33+ _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):-""}
34 }
35
36 _pass_complete_entries_with_subdirs () {