From 7f1a262999d7a8b7f12a97daf4b6722638dc62a1 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Thu, 25 May 2023 21:06:40 +0200 Subject: more progress instead of print, more references --- src/main.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 0e040b6..7e00368 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,10 +15,6 @@ struct Cli { /// config file path #[arg(short, long)] config: Option, - - /// Force GameVersion update - #[arg(long)] - force_gameupdate: bool, } #[derive(Subcommand)] @@ -30,6 +26,10 @@ enum Commands { List { #[command(subcommand)] command: ListCommands, + + /// Force GameVersion update + #[arg(long)] + force_gameupdate: bool, }, Download { /// download all lists @@ -200,7 +200,7 @@ async fn main() { } } } - Commands::List { command } => { + Commands::List { command, force_gameupdate } => { match command { ListCommands::Add { id, @@ -215,8 +215,8 @@ async fn main() { let versions_path = &config.versions; let ver = match version { - Some(ver) => VersionLevel::from(&ver).get(versions_path, cli.force_gameupdate).await.unwrap(), - None => config.defaults.version.clone().get(versions_path, cli.force_gameupdate).await.unwrap(), + Some(ver) => VersionLevel::from(&ver).get(versions_path, force_gameupdate).await.unwrap(), + None => config.defaults.version.clone().get(versions_path, force_gameupdate).await.unwrap(), }; list_add(&config, &id, &ver, &ml, &directory) @@ -254,6 +254,7 @@ async fn main() { }; liststack.push(current) } + update(&config, liststack, clean, download, remove).await } Commands::Download { all, clean, remove, list } => { -- cgit v1.2.3