summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/list.rs16
-rw-r--r--src/commands/mod.rs20
2 files changed, 19 insertions, 17 deletions
diff --git a/src/commands/list.rs b/src/commands/list.rs
index 3998cce..2fec1c7 100644
--- a/src/commands/list.rs
+++ b/src/commands/list.rs
@@ -1,6 +1,6 @@
1use std::io::{Error, ErrorKind}; 1use std::io::{Error, ErrorKind};
2 2
3use crate::{db::{lists_insert, lists_remove, config_change_current_list, lists_get_all_ids, config_get_current_list, lists_get, lists_version}, Modloader, config::Cfg, input::{Input, Subcmd}, cmd_update, error::{MLE, ErrorType, MLError}, modrinth::MCVersionType}; 3use crate::{db::{lists_insert, lists_remove, config_change_current_list, lists_get_all_ids, config_get_current_list, lists_get, lists_version}, Modloader, config::Cfg, input::{Input, ListOptions}, /*cmd_update,*/ error::{MLE, ErrorType, MLError}, /*modrinth::MCVersionType*/};
4 4
5#[derive(Debug, Clone, PartialEq, Eq)] 5#[derive(Debug, Clone, PartialEq, Eq)]
6pub struct List { 6pub struct List {
@@ -9,20 +9,20 @@ pub struct List {
9 pub modloader: Modloader, 9 pub modloader: Modloader,
10 pub download_folder: String, 10 pub download_folder: String,
11} 11}
12 12/*
13pub async fn list(config: Cfg, input: Input) -> Result<(), Box<dyn std::error::Error>> { 13pub async fn list(config: Cfg, input: Input) -> Result<(), Box<dyn std::error::Error>> {
14 14
15 match input.subcommand.ok_or("")? { 15 match input.list_options.ok_or("")? {
16 Subcmd::Add => { 16 ListOptions::Add => {
17 match add(config, input.args.ok_or("")?) { 17 match add(config, input.args.ok_or("")?) {
18 Ok(..) => Ok(()), 18 Ok(..) => Ok(()),
19 Err(e) => Err(Box::new(e)) 19 Err(e) => Err(Box::new(e))
20 } 20 }
21 }, 21 },
22 Subcmd::Change => { 22 ListOptions::Change => {
23 change(config, input.args) 23 change(config, input.args)
24 }, 24 },
25 Subcmd::Remove => { 25 ListOptions::Remove => {
26 match remove(config, input.args.ok_or("")?) { 26 match remove(config, input.args.ok_or("")?) {
27 Ok(..) => Ok(()), 27 Ok(..) => Ok(()),
28 Err(e) => Err(Box::new(e)) 28 Err(e) => Err(Box::new(e))
@@ -39,7 +39,7 @@ pub async fn list(config: Cfg, input: Input) -> Result<(), Box<dyn std::error::E
39 } 39 }
40 } 40 }
41} 41}
42 42*/
43pub fn get_current_list(config: Cfg) -> MLE<List> { 43pub fn get_current_list(config: Cfg) -> MLE<List> {
44 let id = config_get_current_list(config.clone())?; 44 let id = config_get_current_list(config.clone())?;
45 lists_get(config, id) 45 lists_get(config, id)
@@ -83,6 +83,7 @@ fn remove(config: Cfg, args: Vec<String>) -> MLE<()> {
83 } 83 }
84} 84}
85 85
86/*
86///Changing the current lists version and updating it 87///Changing the current lists version and updating it
87/// #Arguments 88/// #Arguments
88/// 89///
@@ -95,3 +96,4 @@ async fn version(config: Cfg, args: Option<Vec<String>>, version_type: Option<MC
95 //update the list & with -- args 96 //update the list & with -- args
96 cmd_update(config, vec![current_list], true, true, false).await 97 cmd_update(config, vec![current_list], true, true, false).await
97} 98}
99*/
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index 0d5bd00..29fc600 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -1,13 +1,13 @@
1pub mod modification; 1//pub mod modification;
2pub mod list; 2pub mod list;
3pub mod update; 3//pub mod update;
4pub mod setup; 4//pub mod setup;
5pub mod download; 5//pub mod download;
6pub mod io; 6//pub mod io;
7 7
8pub use modification::*; 8//pub use modification::*;
9pub use list::*; 9pub use list::*;
10pub use update::*; 10//pub use update::*;
11pub use setup::*; 11//pub use setup::*;
12pub use download::*; 12//pub use download::*;
13pub use io::*; 13//pub use io::*;