commit e00f8e5026f8ea86de743d4133f6460c81dc759e
parent b7ffece867bc68d0ebecc50c52fe19fedd53fab7
Author: Johann150 <johann.galle@protonmail.com>
Date: Sat, 27 Feb 2021 20:46:08 +0100
add version info flag
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/main.rs b/src/main.rs
@@ -129,6 +129,7 @@ fn args() -> Result<Args> {
);
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<Args> {
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)?);