password-store

Simple password manager using gpg and ordinary unix directories
git clone https://git.zx2c4.com/password-store
Log | Files | Refs | README | LICENSE

commit 5ef311735c74320483248da2ea68c38eb84ae768
parent e43b019042574d33510ca70f1f2389e414fa6102
Author: Elan Ruusamäe <glen@pld-linux.org>
Date:   Wed, 12 Sep 2018 23:47:41 +0300

bash-completion: detect whether to use gpg/gpg2 binary for complete keys

Signed-off-by: Elan Ruusamäe <glen@pld-linux.org>

Diffstat:
Msrc/completion/pass.bash-completion | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion @@ -71,9 +71,12 @@ _pass_complete_folders () { } _pass_complete_keys () { + local GPG="gpg" + which gpg2 &>/dev/null && GPG="gpg2" + local IFS=$'\n' # Extract names and email addresses from gpg --list-keys - local keys="$(gpg2 --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d')" + local keys="$($GPG --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d')" COMPREPLY+=($(compgen -W "${keys}" -- ${cur})) }