diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index dd2da1c..c231d90 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,7 @@ fn main() { let mut opts = Options::new(); opts.optflag("h", "help", "print this help menu"); + opts.optflag("V", "version", "show the program version"); let matches = match opts.parse(&args[1..]) { Ok(m) => m, @@ -28,6 +29,11 @@ fn main() { process::exit(exitcode::USAGE); } + if matches.opt_present("V") { + println!("{}", env!("CARGO_PKG_VERSION")); + process::exit(exitcode::OK); + } + let repo = match Repository::open(".") { Ok(r) => r, Err(e) => { |