summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2023-05-09 21:02:23 +0200
committerfxqnlr <[email protected]>2023-05-09 21:02:23 +0200
commitbfc5c2c68007785b3d58724c0dae355162341866 (patch)
tree120a59ed76b1e15f258d336627579a5bde7ec85b /src
parentd6415cf0e03dbb42c573a597d07ea1be5cd1fc44 (diff)
downloadmodlist-bfc5c2c68007785b3d58724c0dae355162341866.tar
modlist-bfc5c2c68007785b3d58724c0dae355162341866.tar.gz
modlist-bfc5c2c68007785b3d58724c0dae355162341866.zip
added list for lists
Diffstat (limited to 'src')
-rw-r--r--src/commands/list.rs9
-rw-r--r--src/main.rs4
2 files changed, 11 insertions, 2 deletions
diff --git a/src/commands/list.rs b/src/commands/list.rs
index 8ec662d..4aa4306 100644
--- a/src/commands/list.rs
+++ b/src/commands/list.rs
@@ -70,3 +70,12 @@ pub async fn list_version(
70 let list = lists_get(config.clone(), id)?; 70 let list = lists_get(config.clone(), id)?;
71 update(config, vec![list], true, download, delete).await 71 update(config, vec![list], true, download, delete).await
72} 72}
73
74pub fn list_list(config: Cfg) -> MLE<()> {
75 let lists = lists_get_all_ids(config.clone())?;
76 for list in lists {
77 let l = lists_get(config.clone(), list)?;
78 println!("{}: | {} | {}", l.id, l.mc_version, l.modloader)
79 }
80 Ok(())
81}
diff --git a/src/main.rs b/src/main.rs
index 4239dc1..4979386 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -3,7 +3,7 @@ use modlist::{
3 config::Cfg, 3 config::Cfg,
4 db::{config_get_current_list, lists_get, lists_get_all_ids}, 4 db::{config_get_current_list, lists_get, lists_get_all_ids},
5 download, export, get_current_list, import, list_add, list_change, list_remove, list_version, 5 download, export, get_current_list, import, list_add, list_change, list_remove, list_version,
6 mod_add, mod_remove, update, IDSelector, List, Modloader, VersionLevel, 6 mod_add, mod_remove, update, IDSelector, List, Modloader, VersionLevel, list_list,
7}; 7};
8 8
9#[derive(Parser)] 9#[derive(Parser)]
@@ -222,7 +222,7 @@ async fn main() {
222 } 222 }
223 ListCommands::Remove { id } => list_remove(config, id), 223 ListCommands::Remove { id } => list_remove(config, id),
224 ListCommands::List => { 224 ListCommands::List => {
225 todo!() 225 list_list(config)
226 } 226 }
227 ListCommands::Change { id } => list_change(config, id), 227 ListCommands::Change { id } => list_change(config, id),
228 ListCommands::Version { 228 ListCommands::Version {