diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b8754e..9cec4d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +* Have help exit with successfully with `0` rather than `1` + ## [2.5.2] - 2021-02-12 ### Fixed diff --git a/src/main.rs b/src/main.rs index 8855668..5645200 100644 --- a/src/main.rs +++ b/src/main.rs @@ -146,8 +146,8 @@ fn args() -> Result { let matches = opts.parse(&args[1..]).map_err(|f| f.to_string())?; if matches.opt_present("h") { - let usage = opts.usage(&format!("Usage: {} [options]", &args[0])); - return Err(usage.into()); + eprintln!("{}", opts.usage(&format!("Usage: {} [options]", &args[0]))); + std::process::exit(0); } let mut hostnames = vec![]; for s in matches.opt_strs("hostname") {