summaryrefslogtreecommitdiffstats
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2018-06-18 22:47:48 +0300
committerDaniel Shahaf <d.s@daniel.shahaf.name>2018-07-01 16:27:08 +0000
commite96e45ba98c2b0439544b994f4c87d49524adae9 (patch)
tree85a06e7b8476b68a26a7b7fa7417c2f45b5f5ec6 /Completion/Unix/Command
parent43107: add an option to _ttys to complete only open ttys (diff)
downloadzsh-e96e45ba98c2b0439544b994f4c87d49524adae9.tar
zsh-e96e45ba98c2b0439544b994f4c87d49524adae9.tar.gz
zsh-e96e45ba98c2b0439544b994f4c87d49524adae9.tar.bz2
zsh-e96e45ba98c2b0439544b994f4c87d49524adae9.tar.lz
zsh-e96e45ba98c2b0439544b994f4c87d49524adae9.tar.xz
zsh-e96e45ba98c2b0439544b994f4c87d49524adae9.tar.zst
zsh-e96e45ba98c2b0439544b994f4c87d49524adae9.zip
43059: _gpg: Use explicit UIDs for state = public keys.
Use the `--with-colons` option and parse the output according to the format specified in the documentation.
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_gpg62
1 files changed, 55 insertions, 7 deletions
diff --git a/Completion/Unix/Command/_gpg b/Completion/Unix/Command/_gpg
index 48a36eff2..b35693d1f 100644
--- a/Completion/Unix/Command/_gpg
+++ b/Completion/Unix/Command/_gpg
@@ -206,20 +206,68 @@ fi
case "$state" in
public-keys)
- _wanted public-keys expl 'public key' \
- compadd ${${(Mo)$(_call_program public-keys $words[1] $needed --list-public-keys --list-options no-show-photos):%<*>}//(<|>)/} && return
+ local public_keys_lines=(${(f)"$(_call_program public-keys ${(q)words[1]} ${(q)needed} --list-public-keys --list-options no-show-photos --with-colons)"})
+ local -a uids emails
+ local i j parts current_uid
+ for (( i = 1; i < ${#public_keys_lines[@]}; ++i )); do
+ parts=("${(@s.:.)public_keys_lines[$i]}")
+ if [[ ${parts[1]} == "fpr" ]]; then