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
This commit is contained in:
Daniel Gray 2020-01-17 11:11:51 -04:00
parent f3683a9792
commit a1445b0f3b
2 changed files with 3 additions and 2 deletions

View file

@ -49,6 +49,7 @@ maintenance = {status = "actively-developed"}
[dependencies] [dependencies]
bitflags = "1.2" bitflags = "1.2"
exitcode = "1.1.2"
unicode-width = "0.1.4" unicode-width = "0.1.4"
textwrap = "0.11" textwrap = "0.11"
indexmap = "1.0.1" indexmap = "1.0.1"

View file

@ -1193,7 +1193,7 @@ impl<'b> App<'b> {
i.lock().read_line(&mut s).unwrap(); i.lock().read_line(&mut s).unwrap();
} }
drop(e); drop(e);
process::exit(1); process::exit(exitcode::USAGE);
} }
e.exit() e.exit()
@ -1268,7 +1268,7 @@ impl<'b> App<'b> {
} }
drop(self); drop(self);
drop(e); drop(e);
process::exit(1); process::exit(exitcode::USAGE);
} }
drop(self); drop(self);