From d0d282de34e77263129770ab28b8ec97d115ba72 Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Wed, 4 Jan 2023 13:41:27 +0100 Subject: started version implementation --- src/input.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/input.rs') diff --git a/src/input.rs b/src/input.rs index 09d05a1..d048775 100644 --- a/src/input.rs +++ b/src/input.rs @@ -46,7 +46,18 @@ impl Input { } if version { - println!("Modlist by FxQnLr v{}", env!("CARGO_PKG_VERSION")); + match std::env::var("DEV") { + Ok(dev) => { + let devint = dev.parse::().unwrap(); + if devint >= 1 { + println!("Modlist by FxQnLr v{} (DEV)", env!("CARGO_PKG_VERSION")); + } else { + println!("Modlist by FxQnLr v{}", env!("CARGO_PKG_VERSION")); + } + }, + Err(..) => println!("Modlist by FxQnLr v{}", env!("CARGO_PKG_VERSION")), + } + std::process::exit(0); } @@ -101,6 +112,7 @@ pub enum Subcmd { Add, Remove, Change, + Version, Export, Import, } @@ -111,6 +123,7 @@ impl Subcmd { "add" => Self::Add, "remove" => Self::Remove, "change" => Self::Change, + "version" => Self::Version, "export" => Self::Export, "import" => Self::Import, _ => return Err(MLError::new(ErrorType::ArgumentError, "SUBCMD_NOT_FOUND")) @@ -132,7 +145,7 @@ pub async fn get_input(config: Cfg) -> Result<(), Box> { modification(config, input).await }, Cmd::List => { - list(config, input) + list(config, input).await }, Cmd::Update => { update(config, input).await -- cgit v1.2.3