mirror of
https://github.com/YGGverse/agate.git
synced 2026-04-08 20:45:29 +00:00
have help exit with code 0
This commit is contained in:
parent
3ba808ca79
commit
4e130dc89e
2 changed files with 4 additions and 2 deletions
|
|
@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
* Have help exit with successfully with `0` rather than `1`
|
||||||
|
|
||||||
## [2.5.2] - 2021-02-12
|
## [2.5.2] - 2021-02-12
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
||||||
|
|
@ -146,8 +146,8 @@ fn args() -> Result<Args> {
|
||||||
|
|
||||||
let matches = opts.parse(&args[1..]).map_err(|f| f.to_string())?;
|
let matches = opts.parse(&args[1..]).map_err(|f| f.to_string())?;
|
||||||
if matches.opt_present("h") {
|
if matches.opt_present("h") {
|
||||||
let usage = opts.usage(&format!("Usage: {} [options]", &args[0]));
|
eprintln!("{}", opts.usage(&format!("Usage: {} [options]", &args[0])));
|
||||||
return Err(usage.into());
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
let mut hostnames = vec![];
|
let mut hostnames = vec![];
|
||||||
for s in matches.opt_strs("hostname") {
|
for s in matches.opt_strs("hostname") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue