Skip to content

Commit

Permalink
add version check option (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkwalExe authored Apr 1, 2022
1 parent 7ef3370 commit c1ad35f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Binary file modified images/usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ fn main() {
process::exit(0);
}


"--version-check" => {
// allow other programs to check if the version is up to date
print!("{}", env!("CARGO_PKG_VERSION"));
process::exit(0);
}

"-h" | "--help" => {
// print help and exit
println!("{}{} cow-translator {}", WHITE, BG_MAGENTA, RESET);
Expand Down Expand Up @@ -190,6 +197,11 @@ fn main() {
"\t{}--no-color, -nc: {}Dont color the output{}",
MAGENTA, YELLOW, RESET
);
println!(
"\t{}--ignore-wrong-characters, -i: {}Ignore wrong characters{}",
MAGENTA, YELLOW, RESET
);
println!("\t{}--version-check: {}Prints the version of the program{}", MAGENTA, YELLOW, RESET);
println!(
"\t{}-- [text] : {}Specify the text to convert{}",
MAGENTA, YELLOW, RESET
Expand Down

0 comments on commit c1ad35f

Please sign in to comment.