diff --git a/src/main.rs b/src/main.rs index 97c8efa..b54416b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -129,6 +129,7 @@ fn args() -> Result { ); opts.optflag("s", "silent", "Disable logging output"); opts.optflag("h", "help", "Print this help menu and exit."); + opts.optflag("V", "version", "Print version information and exit."); opts.optflag( "3", "only-tls13", @@ -151,6 +152,10 @@ fn args() -> Result { eprintln!("{}", opts.usage(&format!("Usage: {} [options]", &args[0]))); std::process::exit(0); } + if matches.opt_present("V") { + eprintln!("agate {}", env!("CARGO_PKG_VERSION")); + std::process::exit(0); + } let mut hostnames = vec![]; for s in matches.opt_strs("hostname") { hostnames.push(Host::parse(&s)?);