Skip to content

Commit

Permalink
fix CLI parser exit point
Browse files Browse the repository at this point in the history
  • Loading branch information
Aloso committed Jun 12, 2023
1 parent 7bff487 commit b8b6511
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,15 @@ pub fn parse_cli_args() {
let args = std::env::args().skip(1);
for arg in args {
match arg.as_str() {
"--help" | "-h" => {
print_help();
break;
}
"--version" | "-v" | "-V" => {
print_version();
break;
}
"--help" | "-h" => print_help(),
"--version" | "-v" | "-V" => print_version(),
_ => {
unknown_argument(&arg);
std::process::exit(1);
}
}
std::process::exit(0);
}
std::process::exit(0);
}

fn print_help() {
Expand Down

0 comments on commit b8b6511

Please sign in to comment.