forked from AbleOS/ableos_userland
Update shell version
This commit is contained in:
parent
9dd3d94b71
commit
d8b9392bad
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -237,6 +237,7 @@ name = "shell"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clparse",
|
"clparse",
|
||||||
|
"versioning",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -41,7 +41,7 @@ impl Version {
|
||||||
|
|
||||||
impl Display for Version {
|
impl Display for Version {
|
||||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,3 +7,4 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clparse = { path = "../../libraries/clparse" }
|
clparse = { path = "../../libraries/clparse" }
|
||||||
|
versioning = { path = "../../libraries/versioning" }
|
||||||
|
|
|
@ -5,7 +5,9 @@ use std::{
|
||||||
process::{Child, Command, Stdio},
|
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() {
|
fn main() {
|
||||||
let ret = clparse::Arguments::parse_from_args().unwrap();
|
let ret = clparse::Arguments::parse_from_args().unwrap();
|
||||||
let config = ret.0;
|
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);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue