handle version printing correctly

This commit is contained in:
Valerie Wolfe 2022-06-27 21:48:09 -04:00
parent 594345785b
commit 027eb64ddc
3 changed files with 3 additions and 5 deletions

2
Cargo.lock generated
View file

@ -13,7 +13,7 @@ dependencies = [
[[package]] [[package]]
name = "config" name = "config"
version = "0.1.0" version = "0.1.1"
dependencies = [ dependencies = [
"regex", "regex",
"toml", "toml",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "config" name = "config"
version = "0.1.1" version = "0.1.2"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -16,8 +16,6 @@ use toml::Value;
mod error; mod error;
pub const VERSION: &str = "0.1.1";
fn main() -> Result<(), Box<dyn Error>>{ fn main() -> Result<(), Box<dyn Error>>{
let home_dir = var("HOME").unwrap(); let home_dir = var("HOME").unwrap();
let mut config_path = PathBuf::from(&home_dir); let mut config_path = PathBuf::from(&home_dir);
@ -161,7 +159,7 @@ fn main() -> Result<(), Box<dyn Error>>{
} }
fn help_text() { fn help_text() {
println!("config v{}", VERSION); println!("config v{}", env!("CARGO_PKG_VERSION"));
println!("Valerie Wolfe <sleeplessval@gmail.com>"); println!("Valerie Wolfe <sleeplessval@gmail.com>");
println!("A configuration manager written in Rust.\n"); println!("A configuration manager written in Rust.\n");
println!("USAGE:"); println!("USAGE:");