decdn_common/cli/key_gen.rs
1//! Arguments for the `decdn key-gen` subcommand.
2
3use std::path::PathBuf;
4
5use clap::Args;
6
7/// Generate a new Ed25519 node key and Ethereum keystore.
8#[derive(Args, Debug)]
9pub struct KeyGenArgs {
10 /// Output directory for generated keys [default: ~/.decdn].
11 #[arg(long, value_name = "DIR")]
12 pub output_dir: Option<PathBuf>,
13
14 /// Overwrite existing keys if present.
15 #[arg(long)]
16 pub force: bool,
17
18 /// File whose contents are the keystore password. Consulted after the
19 /// `DECDN_KEYSTORE_PASSWORD` env var and before an interactive prompt on a
20 /// TTY. A single trailing newline is stripped; a file that is empty after
21 /// that strip is a deliberate empty password, not an absent source. A path
22 /// that does not exist falls through; one that exists but cannot be read is
23 /// an error.
24 #[arg(long, value_name = "PATH", env = "DECDN_KEYSTORE_PASSWORD_FILE")]
25 pub keystore_password_file: Option<PathBuf>,
26}