Skip to content

Commit

Permalink
better pubkey help message
Browse files Browse the repository at this point in the history
and use the command line as key files instead of keys — this is more consistent
with the advice to use the keys from files.
  • Loading branch information
glehmann committed Feb 2, 2024
1 parent f06fa5d commit 5a730b5
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,32 @@ pub struct KeygenArgs {
pub output: PathBuf,
}

/// Convert private keys to their public key
/// Convert private age keys to their public key
///
/// The input key and output public key are in the age format, which is compatible with the age tool.
#[derive(Args, Debug)]
pub struct PubkeyArgs {
/// Decrypt with the specified key
#[clap(env = "YAGE_KEY")]
pub keys: Vec<String>,

/// Decrypt with the key at PATH
#[clap(short = 'K', long = "key-file", name = "PATH", env = "YAGE_KEY_FILE")]
/// The private key files
///
/// If the filename is -, the keys are read from the standard input.
///
/// May be repeated.
#[clap(env = "YAGE_KEY_FILE")]
pub key_files: Vec<PathBuf>,

/// The output path to the private key file
/// The private keys
///
/// Note that passing private keys as arguments or environment variables may expose them to other users
/// on the system, and store them in your shell history. As a consequence the --key option and YAGE_KEY
/// environment variable should only be used in a secure environment.
///
/// May be repeated.
#[clap(short, long = "key", name = "KEY", env = "YAGE_KEY")]
pub keys: Vec<String>,

/// The output path to the public key file
///
/// The public keys are written to the standard output by default.
#[clap(short, long, default_value = "-")]
pub output: PathBuf,
}
Expand Down

0 comments on commit 5a730b5

Please sign in to comment.