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
# -----------
#
# 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
@ -13,19 +13,28 @@
#
# ------------------------------------------------------------------------------
_arguments \
-A '-*' \
'(- *)'{-h,--help}'[show help message and exit]' \
'(-e --encrypt -d --decrypt)'{-e,--encrypt}'[Encrypt INPUT to OUTPUT]' \
'(-e --encrypt -d --decrypt -a --armor -p --passphrase -r --recipient -R --recipients-file)'{-d,--decrypt}'[Decrypt INPUT to OUTPUT]' \
\*{-i,--identity=}'[Encrypt/Decrypt using the identities at PATH]:IDENTITY:_files' \
'(-o --output)'{-o,--output=}'[Write encrypted/decrypted file to OUTPUT]:OUTPUT:_files' \
'(-j --plugin)'{-j,--plugin=}'[Encrypt/Decrypt using the data-less PLUGIN]:PLUGIN:' \
'(-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' \
'(-a --armor -d --decrypt)'{-a,--armor}'[Encrypt to an ASCII-only "armored" encoding]' \
'(-p --passphrase -d --decrypt)'{-p,--passphrase}'[Encrypt with a passphrase]' \
:INPUT:_files
case $service in
(age)
_arguments \
-A '-*' \
'(- *)'{-h,--help}'[show help message and exit]' \
'(-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 the input to the output]' \
'(-o --output)'{-o,--output=}'[Write the result to the given file]:OUTPUT:_files' \
'(-a --armor -d --decrypt)'{-a,--armor}'[Encrypt to a PEM encoded format]' \
'(-p --passphrase -d --decrypt)'{-p,--passphrase}'[Encrypt with a passphrase]' \
'(-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' \
\*{-i,--identity=}'[Use the given identify file]:IDENTITY:_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:
# mode: Shell-Script