agate

Simple gemini server for static files
git clone https://github.com/mbrubeck/agate.git
Log | Files | Refs | README

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:
MCHANGELOG.md | 2++
Msrc/main.rs | 4++--
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") {