diff options
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Unix/Command/_gpg | 8 |
1 files changed, 6 insertions, 2 deletions
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}") |