Skip to content

Commit

Permalink
Add a --version option.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Jul 25, 2023
1 parent 587a914 commit 789d5e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ USAGE:
OPTIONS:
-h, --help Print help information
--version Print version information
-i, -w Integral weighting of lines
-f Fractional weighting of lines
-e Erase weights after applying, replacing them with `NNN`
";

const VERSION: &'static str = "0.2.0";

fn do_main() -> io::Result<()> {
// Process args.
let mut weights = Unit;
Expand All @@ -56,6 +59,9 @@ fn do_main() -> io::Result<()> {
if arg == "-h" || arg == "--help" {
println!("{}", USAGE);
return Ok(());
} else if arg == "--version" {
println!("counts-{VERSION}");
std::process::exit(1);
} else if arg == "-i" || arg == "-w" {
weights = Integral;
} else if arg == "-f" {
Expand Down

0 comments on commit 789d5e1

Please sign in to comment.