From bfc5c2c68007785b3d58724c0dae355162341866 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Tue, 9 May 2023 21:02:23 +0200 Subject: added list for lists --- src/commands/list.rs | 9 +++++++++ src/main.rs | 4 ++-- 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( let list = lists_get(config.clone(), id)?; update(config, vec![list], true, download, delete).await } + +pub fn list_list(config: Cfg) -> MLE<()> { + let lists = lists_get_all_ids(config.clone())?; + for list in lists { + let l = lists_get(config.clone(), list)?; + println!("{}: | {} | {}", l.id, l.mc_version, l.modloader) + } + Ok(()) +} 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::{ config::Cfg, db::{config_get_current_list, lists_get, lists_get_all_ids}, download, export, get_current_list, import, list_add, list_change, list_remove, list_version, - mod_add, mod_remove, update, IDSelector, List, Modloader, VersionLevel, + mod_add, mod_remove, update, IDSelector, List, Modloader, VersionLevel, list_list, }; #[derive(Parser)] @@ -222,7 +222,7 @@ async fn main() { } ListCommands::Remove { id } => list_remove(config, id), ListCommands::List => { - todo!() + list_list(config) } ListCommands::Change { id } => list_change(config, id), ListCommands::Version { -- cgit v1.2.3