mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 06:12:40 +00:00
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:
parent
f3683a9792
commit
a1445b0f3b
2 changed files with 3 additions and 2 deletions
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue