From a1445b0f3bd8fe4fabd0ffda3eebca3cb94a5db8 Mon Sep 17 00:00:00 2001 From: Daniel Gray Date: Fri, 17 Jan 2020 11:11:51 -0400 Subject: [PATCH] imp: Add exitcode::USAGE exit code as suggested in #1327 The reason to do this is described well in issue #1327. It is also a recommendation of the Rust book itself: https://rust-cli.github.io/book/in-depth/exit-code.html --- Cargo.toml | 1 + src/build/app/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d0ea231ef4d..4bbeda51f76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,7 @@ maintenance = {status = "actively-developed"} [dependencies] bitflags = "1.2" +exitcode = "1.1.2" unicode-width = "0.1.4" textwrap = "0.11" indexmap = "1.0.1" diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs index 27a13961203..95e56e880fc 100644 --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -1193,7 +1193,7 @@ impl<'b> App<'b> { i.lock().read_line(&mut s).unwrap(); } drop(e); - process::exit(1); + process::exit(exitcode::USAGE); } e.exit() @@ -1268,7 +1268,7 @@ impl<'b> App<'b> { } drop(self); drop(e); - process::exit(1); + process::exit(exitcode::USAGE); } drop(self);