diff --git a/Cargo.toml b/Cargo.toml index 9e6f33c..45e107b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ openssl = ["domain/openssl"] ring = ["domain/ring"] [dependencies] -clap = { version = "4", features = ["derive"] } +clap = { version = "4", features = ["cargo", "derive"] } domain = { git = "http://github.com/NLnetLabs/domain", branch = "main", features = ["unstable-sign"] } lexopt = "0.3.0" diff --git a/src/commands/keygen.rs b/src/commands/keygen.rs index 4c72a97..b2d873b 100644 --- a/src/commands/keygen.rs +++ b/src/commands/keygen.rs @@ -108,7 +108,14 @@ impl LdnsCommand for Keygen { force_symlinks = true; } - // TODO: '-v' version argument? + Arg::Short('v') => { + let version = clap::crate_version!(); + // NOTE: The outer version is the latest version of 'ldns-keygen' we are + // compatible with. This needs to be updated manually. + println!("DNSSEC key generator version 1.8.4 (dnst version {version})"); + std::process::exit(0); + } + Arg::Value(value) => { if name.is_some() { return Err("cannot specify multiple domain names".into());