[keygen] Implement '-v' with version info

This commit is contained in:
arya dradjica
2024-11-15 10:06:58 +01:00
parent 0ef9f0ad54
commit 643ab86bd4
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -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"
+8 -1
View File
@@ -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());