Merge pull request #1190 from zsh-users/update-age

Update age completion and support age-keygen
This commit is contained in:
Shohei YOSHIDA 2025-12-10 23:44:06 +09:00 committed by GitHub
commit 7dd5752396
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 24 additions and 15 deletions

View File

@ -1,9 +1,9 @@
#compdef age #compdef age age-keygen
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Description # Description
# ----------- # -----------
# #
# Completion script for age 1.1.1 (https://github.com/FiloSottile/age). # Completion script for age 1.2.1 (https://github.com/FiloSottile/age).
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Authors # Authors
@ -13,19 +13,28 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_arguments \ case $service in
(age)
_arguments \
-A '-*' \ -A '-*' \
'(- *)'{-h,--help}'[show help message and exit]' \ '(- *)'{-h,--help}'[show help message and exit]' \
'(-e --encrypt -d --decrypt)'{-e,--encrypt}'[Encrypt INPUT to OUTPUT]' \ '(-e --encrypt -d --decrypt)'{-e,--encrypt}'[Encrypt the input to the output. Default if omitted]' \
'(-e --encrypt -d --decrypt -a --armor -p --passphrase -r --recipient -R --recipients-file)'{-d,--decrypt}'[Decrypt INPUT to OUTPUT]' \ '(-e --encrypt -d --decrypt -a --armor -p --passphrase -r --recipient -R --recipients-file)'{-d,--decrypt}'[Decrypt the input to the output]' \
\*{-i,--identity=}'[Encrypt/Decrypt using the identities at PATH]:IDENTITY:_files' \ '(-o --output)'{-o,--output=}'[Write the result to the given file]:OUTPUT:_files' \
'(-o --output)'{-o,--output=}'[Write encrypted/decrypted file to OUTPUT]:OUTPUT:_files' \ '(-a --armor -d --decrypt)'{-a,--armor}'[Encrypt to a PEM encoded format]' \
'(-j --plugin)'{-j,--plugin=}'[Encrypt/Decrypt using the data-less PLUGIN]:PLUGIN:' \ '(-p --passphrase -d --decrypt)'{-p,--passphrase}'[Encrypt with a passphrase]' \
'(-d --decrypt)'\*{-r,--recipient=}'[Encrypt to the explicitly specified RECIPIENT]:RECIPIENT:' \ '(-d --decrypt)'\*{-r,--recipient=}'[Encrypt to the explicitly specified RECIPIENT]:RECIPIENT:' \
'(-d --decrypt)'\*{-R,--recipients-file=}'[Encrypt to the RECIPIENTS listed in the file at PATH]:RECIPIENTS_FILE:_files' \ '(-d --decrypt)'\*{-R,--recipients-file=}'[Encrypt to the RECIPIENTS listed in the file at PATH]:RECIPIENTS_FILE:_files' \
'(-a --armor -d --decrypt)'{-a,--armor}'[Encrypt to an ASCII-only "armored" encoding]' \ \*{-i,--identity=}'[Use the given identify file]:IDENTITY:_files' \
'(-p --passphrase -d --decrypt)'{-p,--passphrase}'[Encrypt with a passphrase]' \
:INPUT:_files :INPUT:_files
;;
(age-keygen)
_arguments \
'(-o --output)'{-o,--output}'[write the result to the given file]:file:_files' \
'-y[convert an identity file to a recipients file]' \
'*:input'
;;
esac
# Local Variables: # Local Variables:
# mode: Shell-Script # mode: Shell-Script