From e00f8e5026f8ea86de743d4133f6460c81dc759e Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sat, 27 Feb 2021 20:46:08 +0100 Subject: [PATCH] add version info flag --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) 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)?);