summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2023-05-25 21:06:40 +0200
committerfxqnlr <[email protected]>2023-05-25 21:06:40 +0200
commit7f1a262999d7a8b7f12a97daf4b6722638dc62a1 (patch)
treec030a952891fba2f64427adad1113efc567ae54d /src/main.rs
parent48393b209396db9ddd44251b2bb445d3ad7533fb (diff)
downloadmodlist-7f1a262999d7a8b7f12a97daf4b6722638dc62a1.tar
modlist-7f1a262999d7a8b7f12a97daf4b6722638dc62a1.tar.gz
modlist-7f1a262999d7a8b7f12a97daf4b6722638dc62a1.zip
more progress instead of print, more references
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs15
1 files changed, 8 insertions, 7 deletions
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 {
15 /// config file path 15 /// config file path
16 #[arg(short, long)] 16 #[arg(short, long)]
17 config: Option<String>, 17 config: Option<String>,
18
19 /// Force GameVersion update
20 #[arg(long)]
21 force_gameupdate: bool,
22} 18}
23 19
24#[derive(Subcommand)] 20#[derive(Subcommand)]
@@ -30,6 +26,10 @@ enum Commands {
30 List { 26 List {
31 #[command(subcommand)] 27 #[command(subcommand)]
32 command: ListCommands, 28 command: ListCommands,
29
30 /// Force GameVersion update
31 #[arg(long)]
32 force_gameupdate: bool,
33 }, 33 },
34 Download { 34 Download {
35 /// download all lists 35 /// download all lists
@@ -200,7 +200,7 @@ async fn main() {
200 } 200 }
201 } 201 }
202 } 202 }
203 Commands::List { command } => { 203 Commands::List { command, force_gameupdate } => {
204 match command { 204 match command {
205 ListCommands::Add { 205 ListCommands::Add {
206 id, 206 id,
@@ -215,8 +215,8 @@ async fn main() {
215 215
216 let versions_path = &config.versions; 216 let versions_path = &config.versions;
217 let ver = match version { 217 let ver = match version {
218 Some(ver) => VersionLevel::from(&ver).get(versions_path, cli.force_gameupdate).await.unwrap(), 218 Some(ver) => VersionLevel::from(&ver).get(versions_path, force_gameupdate).await.unwrap(),
219 None => config.defaults.version.clone().get(versions_path, cli.force_gameupdate).await.unwrap(), 219 None => config.defaults.version.clone().get(versions_path, force_gameupdate).await.unwrap(),
220 }; 220 };
221 221
222 list_add(&config, &id, &ver, &ml, &directory) 222 list_add(&config, &id, &ver, &ml, &directory)
@@ -254,6 +254,7 @@ async fn main() {
254 }; 254 };
255 liststack.push(current) 255 liststack.push(current)
256 } 256 }
257
257 update(&config, liststack, clean, download, remove).await 258 update(&config, liststack, clean, download, remove).await
258 } 259 }
259 Commands::Download { all, clean, remove, list } => { 260 Commands::Download { all, clean, remove, list } => {