Skip to content

Commit

Permalink
add --version flag to print version number
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelarie committed Oct 18, 2024
1 parent 63ada8c commit b9dfffa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/command/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ impl CliArgs {

Some(arg.to_string())
}
"--version" | "-v" => {
println!("v{}", env!("CARGO_PKG_VERSION"));
std::process::exit(0);
}
"--help" | "-h" => Some(arg.to_string()),
_ => {
let chars = arg.chars().collect::<Vec<char>>();
Expand Down

0 comments on commit b9dfffa

Please sign in to comment.