Update shell version

This commit is contained in:
Able 2022-12-05 04:14:26 -06:00
parent 9dd3d94b71
commit d8b9392bad
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);
}