Skip to content

Commit

Permalink
Handle --version/-V
Browse files Browse the repository at this point in the history
  • Loading branch information
lunacookies committed Oct 16, 2023
1 parent 615ab3a commit fd76311
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/pipes-rs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ fn parse_args(config: &mut Config) {
process::exit(0);
}

"--version" | "-V" => {
if args.len() != 1 {
eprintln!("error: provided arguments other than --version");
process::exit(1);
}

println!("pipes-rs {}", env!("CARGO_PKG_VERSION"));
process::exit(0);
}

"--help" => {
println!("{}", include_str!("usage"));
process::exit(0);
Expand Down

0 comments on commit fd76311

Please sign in to comment.