Merge pull request #37 from 06kellyjac/no_help_error

help exit with code 0
This commit is contained in:
Johann150 2021-02-19 10:45:19 +01:00 committed by GitHub
commit ec1b587f2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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") {