From 6dec4885d373c3bfdf4b80b2ce54efecd1206083 Mon Sep 17 00:00:00 2001 From: Hg Date: Tue, 19 Nov 2024 09:09:47 +0100 Subject: [PATCH 1/5] add completion for age --- src/_age | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/_age diff --git a/src/_age b/src/_age new file mode 100644 index 0000000..76439a0 --- /dev/null +++ b/src/_age @@ -0,0 +1,28 @@ +#compdef age +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for neo (https://github.com/FiloSottile/age). +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Hydrargyrum (https://github.com/hydrargyrum) +# +# ------------------------------------------------------------------------------ + +_arguments \ + -A '-*' \ + '(-h --help)'{-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)'{-i,--identity=}'[Encrypt/Decrypt using the identities at PATH]:IDENTITY:' \ + '(-o --output)'{-o,--output=}'[Write encrypted/decrypted file to OUTPUT]:OUTPUT:_files' \ + '(-j --plugin)'{-j,--plugin=}'[Encrypt/Decrypt using the data-less PLUGIN]:PLUGIN:' \ + '(-r --recipient -d --decrypt)'{-r,--recipient=}'[Encrypt to the explicitly specified RECIPIENT]:RECIPIENT:' \ + '(-R --recipients-file -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 From 360ee98d66acd0181507f08eb41004a1041309c9 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Tue, 19 Nov 2024 23:36:00 +0900 Subject: [PATCH 2/5] Fix comment --- src/_age | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_age b/src/_age index 76439a0..0fd9c08 100644 --- a/src/_age +++ b/src/_age @@ -3,7 +3,7 @@ # Description # ----------- # -# Completion script for neo (https://github.com/FiloSottile/age). +# Completion script for age 1.1.1 (https://github.com/FiloSottile/age). # # ------------------------------------------------------------------------------ # Authors From 692e96ce54521c0bb739a7981dcdfc55a471cfbb Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Tue, 19 Nov 2024 23:38:19 +0900 Subject: [PATCH 3/5] Add format information --- src/_age | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/_age b/src/_age index 0fd9c08..a7bfde7 100644 --- a/src/_age +++ b/src/_age @@ -26,3 +26,11 @@ _arguments \ '(-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 + +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et From 610aef9f1276eadbf39ddf1f027f28a21ad682b3 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Tue, 19 Nov 2024 23:36:21 +0900 Subject: [PATCH 4/5] Don't complete options when '--help' is specified --- src/_age | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_age b/src/_age index a7bfde7..ae27274 100644 --- a/src/_age +++ b/src/_age @@ -15,7 +15,7 @@ _arguments \ -A '-*' \ - '(-h --help)'{-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 -a --armor -p --passphrase -r --recipient -R --recipients-file)'{-d,--decrypt}'[Decrypt INPUT to OUTPUT]' \ '(-i --identity)'{-i,--identity=}'[Encrypt/Decrypt using the identities at PATH]:IDENTITY:' \ From 8d427173871f44b44828a97bdc18246ba67aec6f Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Tue, 19 Nov 2024 23:36:50 +0900 Subject: [PATCH 5/5] Fix options that can be specified many times --- src/_age | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_age b/src/_age index ae27274..c30291f 100644 --- a/src/_age +++ b/src/_age @@ -18,11 +18,11 @@ _arguments \ '(- *)'{-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)'{-i,--identity=}'[Encrypt/Decrypt using the identities at PATH]:IDENTITY:' \ + \*{-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:' \ - '(-r --recipient -d --decrypt)'{-r,--recipient=}'[Encrypt to the explicitly specified RECIPIENT]:RECIPIENT:' \ - '(-R --recipients-file -d --decrypt)'{-R,--recipients-file=}'[Encrypt to the RECIPIENTS listed in the file at PATH]:RECIPIENTS_FILE:_files' \ + '(-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