From bad8bfc9bec16d27cfd53ae1a2d3ced10aa13966 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 22 Sep 2012 18:43:16 +0200 Subject: Vastly simplify GPG secret key finding logic. - Only use secret keys - Use entire UID - --with-colons makes parsing easy --- contrib/pass.bash-completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/pass.bash-completion b/contrib/pass.bash-completion index 1b9e20e..5b05f12 100644 --- a/contrib/pass.bash-completion +++ b/contrib/pass.bash-completion @@ -40,7 +40,7 @@ _pass_complete_entries () { _pass_complete_keys () { local IFS=$'\n' # Extract names and email addresses from gpg --list-keys - local keys="$(gpg --list-keys | grep uid | sed -e 's/uid *\([^<]*\)\(<\(.*\)>\)\?/\1\n\3/' | sed -e 's/\(^ *\| *$\)//g')" + local keys="$(gpg --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d')" COMPREPLY+=($(compgen -W "${keys}" -- ${cur})) } -- cgit v1.2.3