summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2021-03-05 06:48:20 -0500
committerAdam T. Carpenter <atc@53hor.net>2021-03-05 06:48:20 -0500
commit9390cd3eb1a128dab81dd26b60265a027da26bd5 (patch)
tree1887c81660e757983a5c8edb59710987130b64c2 /src
parent2b23cd283cc8a25689cf6400d86309a2a1f0ffad (diff)
downloadtitler-9390cd3eb1a128dab81dd26b60265a027da26bd5.tar.xz
titler-9390cd3eb1a128dab81dd26b60265a027da26bd5.zip
added version messageHEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/main.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index fe1d0eb..f9222c8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,8 +4,11 @@ use std::io::{prelude::*, stdin, stdout, BufReader, BufWriter};
const HELP_MSG: &str = "Title-Case Tool\n\
-h | --help\t\t\tPrints this message\n\
+ -v | --version\t\t\tPrints version number\n\
-i | --ignore [word...]\t\tA list of words that should not be corrected";
+const VERSION_MSG: &str = env!("CARGO_PKG_VERSION");
+
/// Words that will not be capitalized unless they are at the start or end of a title.
const EXCEPTIONS: &[&str] = &[
"vs", "above", "across", "against", "at", "between", "by", "along", "among", "down", "in",
@@ -37,6 +40,10 @@ fn main() {
println!("{}", HELP_MSG);
return;
}
+ "--version" | "-v" => {
+ println!("{}", VERSION_MSG);
+ return;
+ }
unrecognized => {
panic!(format!("Unrecognized option: {}", unrecognized));
}