cmd/age: improve help text (#175)

This commit is contained in:
Richard Ulmer
2021-01-04 20:05:33 +01:00
committed by GitHub
parent a02075a0cc
commit a8573a5c8d
2 changed files with 17 additions and 13 deletions

View File

@@ -21,9 +21,9 @@ An alternative interoperable Rust implementation is available at [github.com/str
```
Usage:
age -r RECIPIENT [-a] [-o OUTPUT] [INPUT]
age (-r RECIPIENT | -R PATH)... [-a] [-o OUTPUT] [INPUT]
age --passphrase [-a] [-o OUTPUT] [INPUT]
age --decrypt [-i KEY] [-o OUTPUT] [INPUT]
age --decrypt [-i KEY]... [-o OUTPUT] [INPUT]
Options:
-o, --output OUTPUT Write the result to the file at path OUTPUT.
@@ -40,11 +40,13 @@ RECIPIENT can be an age public key, as generated by age-keygen, ("age1...")
or an SSH public key ("ssh-ed25519 AAAA...", "ssh-rsa AAAA...").
Recipient files contain one or more recipients, one per line. Empty lines
and lines starting with "#" are ignored as comments.
and lines starting with "#" are ignored as comments. "-" may be used to
read recipients from standard input.
KEY is a path to a file with age secret keys, one per line
(ignoring "#" prefixed comments and empty lines), or to an SSH key file.
Multiple keys can be provided, and any unused ones will be ignored.
KEY is a path to a file with age secret keys, one per line (ignoring "#"
prefixed comments and empty lines), or to an SSH key file. Multiple keys
can be provided, and any unused ones will be ignored. "-" may be used to
read keys from standard input.
```
### Multiple recipients

View File

@@ -32,9 +32,9 @@ func (f *multiFlag) Set(value string) error {
}
const usage = `Usage:
age -r RECIPIENT [-a] [-o OUTPUT] [INPUT]
age (-r RECIPIENT | -R PATH)... [-a] [-o OUTPUT] [INPUT]
age --passphrase [-a] [-o OUTPUT] [INPUT]
age --decrypt [-i KEY] [-o OUTPUT] [INPUT]
age --decrypt [-i KEY]... [-o OUTPUT] [INPUT]
Options:
-o, --output OUTPUT Write the result to the file at path OUTPUT.
@@ -51,11 +51,13 @@ RECIPIENT can be an age public key, as generated by age-keygen, ("age1...")
or an SSH public key ("ssh-ed25519 AAAA...", "ssh-rsa AAAA...").
Recipient files contain one or more recipients, one per line. Empty lines
and lines starting with "#" are ignored as comments.
and lines starting with "#" are ignored as comments. "-" may be used to
read recipients from standard input.
KEY is a path to a file with age secret keys, one per line
(ignoring "#" prefixed comments and empty lines), or to an SSH key file.
Multiple keys can be provided, and any unused ones will be ignored.
KEY is a path to a file with age secret keys, one per line (ignoring "#"
prefixed comments and empty lines), or to an SSH key file. Multiple keys
can be provided, and any unused ones will be ignored. "-" may be used to
read keys from standard input.
Example:
$ age-keygen -o key.txt
@@ -144,7 +146,7 @@ func main() {
}
if len(recipientFlags) == 0 && len(recipientsFileFlags) == 0 && !passFlag {
logFatalf("Error: missing recipients.\n" +
"Did you forget to specify -r/--recipient or -p/--passphrase?")
"Did you forget to specify -r/--recipient, -R/--recipients-file or -p/--passphrase?")
}
if len(recipientFlags) > 0 && passFlag {
logFatalf("Error: -p/--passphrase can't be combined with -r/--recipient.")