Skip to content

Commit

Permalink
pass: update completion (2018-08-03)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcornella committed Aug 9, 2018
1 parent 2c1ff85 commit f2f078a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions plugins/pass/_pass
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 () {
Expand Down Expand Up @@ -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 () {
Expand Down

0 comments on commit f2f078a

Please sign in to comment.