commit ec1b587f2f684718db9df8e1a6b2f19e04e92184
parent 3ba808ca79a69b816a13eccd468adb4f36898929
Author: Johann150 <20990607+Johann150@users.noreply.github.com>
Date: Fri, 19 Feb 2021 10:45:19 +0100
Merge pull request #37 from 06kellyjac/no_help_error
help exit with code 0
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git 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
@@ -146,8 +146,8 @@ fn args() -> Result<Args> {
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") {