Skip to content

Commit

Permalink
Have {-h, --help} flags return 0
Browse files Browse the repository at this point in the history
Have the binary return 0 instead of 1 when the `-h` or `--help` flag is
used. This is what a lot of *nix commands do.
  • Loading branch information
ryankeleti authored and Joshua Nelson committed Aug 11, 2020
1 parent b7a16c2 commit 580a52a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@ fn parse_args() -> Result<(BinOpt, PathBuf), pico_args::Error> {
let mut input = Arguments::from_env();
if input.contains("-h") {
println!("{}", USAGE);
std::process::exit(1);
std::process::exit(0);
} else if input.contains("--help") {
println!("{}", HELP);
std::process::exit(1);
std::process::exit(0);
}
if input.contains(["-V", "--version"]) {
#[cfg(feature = "git-testament")]
Expand Down

0 comments on commit 580a52a

Please sign in to comment.