From 6aa15f57fd5bee298c8320dab19d167dac3d46ed Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 22 Nov 2023 00:07:37 +0100 Subject: 52315: completion options update --- Completion/Unix/Command/_gpg | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Completion/Unix/Command/_gpg') diff --git a/Completion/Unix/Command/_gpg b/Completion/Unix/Command/_gpg index 5d54865d5..2161d2d24 100644 --- a/Completion/Unix/Command/_gpg +++ b/Completion/Unix/Command/_gpg @@ -93,6 +93,7 @@ fi '--no-default-recipient[reset default recipient]' '*--encrypt-to[specify recipient]:key:->public-keys' '(--encrypt-to)--no-encrypt-to[disable the use of all --encrypt-to keys]' + '--group[set up email aliases]:spec' '-z[specify compression level]:compression level:((0\:no\ compression 1\:minimum 2 3 4 5 6\:default 7 8 9\:maximum))' '(-t --textmode)'{-t,--textmode}'[use canonical text mode]' '(-n --dry-run)'{-n,--dry-run}"[don't make any changes]" @@ -117,6 +118,7 @@ fi '--utf8-strings' '--no-utf8-strings[arguments are not in UTF8]' '(--no-options)--options[specify file to read options from]:options file:_files' "(--options)--no-options[don't read options file]" + '--log-file[write server mode logs to file]:file:_files' '--'{attribute,passphrase,command}'-fd:file descriptor:_file_descriptors' '--sk-comments[include secret key comments when exporting keys]' '(--emit-version)--no-emit-version[omit version string in clear text signatures]' @@ -170,6 +172,9 @@ fi '--ctapi-driver[file to use to access smartcard reader]:file:_files' '--pcsc-driver[file to use to access smartcard reader]:file:_files' '--auto-key-locate:parameters' + '--auto-key-import[import missing key from a signature]' + '--include-key-block[include the public key in signatures]' + '--disable-dirmngr[disable all access to the dirmngr]' '--dump-options[show all options]' ) -- cgit v1.2.3 From 1818323f451f426f20ca47c50e8fc63824578479 Mon Sep 17 00:00:00 2001 From: Vadim Misbakh-Soloviov Date: Wed, 19 Feb 2025 17:20:14 +0700 Subject: github #129: fix _gpg completion 1) As for now, `--local-user` completion is irrelevant: it completes system users, while gpg expects private keys IDs 2) `secret-keys` completion was also broken and completed nothing. The reason of that to happen was in that fact that it assumed `uid` token would be next after `fpr` (same as it do in public-keys completion), while in current gnupg versions there is at least `grp` token, and potentially can be others. So, instead i+=2 I made `until "uid"` loop. --- ChangeLog | 3 +++ Completion/Unix/Command/_gpg | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command/_gpg') diff --git a/ChangeLog b/ChangeLog index 80745557f..cd00105cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2025-02-27 Oliver Kiddle + * github #129: Vadim Misbakh-Soloviov: + Completion/Unix/Command/_gpg: fix _gpg completion + * 53378: Doc/Zsh/builtins.yo, Src/Builtins/rlimits.c, configure.ac: support new pipebuf resource limit on FreeBSD diff --git a/Completion/Unix/Command/_gpg b/Completion/Unix/Command/_gpg index 2161d2d24..ea0a452f2 100644 --- a/Completion/Unix/Command/_gpg +++ b/Completion/Unix/Command/_gpg @@ -29,7 +29,7 @@ fi '(-c --symmetric)'{-c,--symmetric}'[encrypt with symmetric cipher only]' '(-s --sign)'{-s,--sign}'[make a signature]' '*'{-r+,--recipient}'[specify user to encrypt for]:recipient:->public-keys' - '(-u --local-user)'{-u+,--local-user}'[use name as the user ID to sign]:user attachment:_users' + '(-u --local-user)'{-u+,--local-user}'[use name as the user ID to sign]:key:->secret-keys' '(-o --output)'{-o+,--output}'[write output to file]:output file:_files' '(-h --help)'{-h,--help}'[display usage information]' '--version[print info on program version and supported algorithms]' @@ -238,7 +238,11 @@ case "$state" in parts=("${(@s.:.)secret_keys_lines[$i]}") if [[ ${parts[1]} == "fpr" ]]; then current_uid="${parts[10]}" - i=$((i + 1)) + until [[ "${${(@s.:.)secret_keys_lines[$i]}[1]}" == "uid" ]] || [[ "${i}" -ge "${#secret_keys_lines[@]}" ]]; do + # it can be "grp" or other tokens. + # Let's iterate until we found "uid" or face an end of secret keys array + i=$((i + 1)) + done parts=("${(@s.:.)secret_keys_lines[$i]}") while [[ ${parts[1]} == "uid" ]]; do uids+=("${current_uid}") -- cgit v1.2.3