summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/main.rs b/src/main.rs
index a1f0c31..038e2f4 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,12 +1,20 @@
1use clap::{Parser, Subcommand}; 1use clap::{Parser, Subcommand};
2use modlist::{ 2
3 config::Cfg, 3pub mod apis;
4 db::{config_get_current_list, lists_get, lists_get_all_ids}, 4pub mod cache;
5 download, 5pub mod commands;
6 error::MLE, 6pub mod config;
7 export, import, mod_add, mod_remove, update, AddMod, IDSelector, 7pub mod db;
8 List, Modloader, VersionLevel, 8pub mod error;
9}; 9pub mod files;
10pub mod data;
11
12use commands::{download::download, io::{export, import}, list, modification::{mod_add, mod_remove}, update::update};
13use config::Cfg;
14use data::{gameversion::VersionLevel, list::List, modification::{AddMod, IDSelector}, modloader::Modloader};
15pub use data::{STYLE_BAR_POS, STYLE_MESSAGE, STYLE_SPINNER, STYLE_BAR_BYTE, STYLE_OPERATION, PROGRESS_CHARS};
16use db::{config_get_current_list, lists_get, lists_get_all_ids};
17use error::MLE;
10 18
11#[derive(Parser)] 19#[derive(Parser)]
12#[command(author, version, about)] 20#[command(author, version, about)]
@@ -308,16 +316,16 @@ async fn handle_list(
308 .unwrap(), 316 .unwrap(),
309 }; 317 };
310 318
311 List::add(&config, &id, &ver, &ml, &directory) 319 list::add(&config, &id, &ver, &ml, &directory)
312 } 320 }
313 ListCommands::Remove { id } => List::remove(&config, &id), 321 ListCommands::Remove { id } => list::remove(&config, &id),
314 ListCommands::List => List::list(&config), 322 ListCommands::List => list::list(&config),
315 ListCommands::Change { id } => List::change(&config, &id), 323 ListCommands::Change { id } => list::change(&config, &id),
316 ListCommands::Version { 324 ListCommands::Version {
317 id, 325 id,
318 version, 326 version,
319 download, 327 download,
320 remove, 328 remove,
321 } => List::version(&config, &id, version, download, remove).await, 329 } => list::version(&config, &id, version, download, remove).await,
322 } 330 }
323} 331}