Update shell version

pull/1/head
Able 2022-12-05 04:14:26 -06:00
parent d209e69659
commit 45c20b9654
Signed by: able
GPG Key ID: 0BD8B45C30DCA887
4 changed files with 13 additions and 2 deletions

1
Cargo.lock generated
View File

@ -237,6 +237,7 @@ name = "shell"
version = "0.1.0"
dependencies = [
"clparse",
"versioning",
]
[[package]]

View File

@ -41,7 +41,7 @@ impl Version {
impl Display for Version {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "v{}.{}.{}", self.major, self.minor, self.patch)?;
write!(f, "{}.{}.{}", self.major, self.minor, self.patch)?;
Ok(())
}
}

View File

@ -7,3 +7,4 @@ edition = "2021"
[dependencies]
clparse = { path = "../../libraries/clparse" }
versioning = { path = "../../libraries/versioning" }

View File

@ -5,7 +5,9 @@ use std::{
process::{Child, Command, Stdio},
};
const VERSION: &str = env!("CARGO_PKG_VERSION");
use versioning::Version;
pub const VERSION: Version = Version::new(0, 1, 0);
fn main() {
let ret = clparse::Arguments::parse_from_args().unwrap();
let config = ret.0;
@ -55,3 +57,10 @@ fn main() {
}
}
}
#[test]
fn sanity_check_version() {
let cargo_version = env!("CARGO_PKG_VERSION");
let str_version = format!("{}", VERSION);
assert_eq!(str_version, cargo_version);
}