summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/list.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/commands/list.rs b/src/commands/list.rs
index 526b434..a02f8b1 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}}; 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};
4 4
5#[derive(Debug, Clone, PartialEq, Eq)] 5#[derive(Debug, Clone, PartialEq, Eq)]
6pub struct List { 6pub struct List {
@@ -26,7 +26,7 @@ pub async fn list(config: Cfg, input: Input) -> Result<(), Box<dyn std::error::E
26 remove(config, input.args.ok_or("")?) 26 remove(config, input.args.ok_or("")?)
27 }, 27 },
28 Subcmd::Version => { 28 Subcmd::Version => {
29 match version(config, input.args.ok_or("NO_VERSION")?).await { 29 match version(config, Some(input.args.ok_or("NO_VERSION")?), Some(MCVersionType::Release)).await {
30 Ok(..) => Ok(()), 30 Ok(..) => Ok(()),
31 Err(e) => Err(Box::new(e)) 31 Err(e) => Err(Box::new(e))
32 } 32 }
@@ -85,10 +85,10 @@ fn remove(config: Cfg, args: Vec<String>) -> Result<(), Box<dyn std::error::Erro
85/// 85///
86/// * `config` - The current config 86/// * `config` - The current config
87/// * `args` - All args, to extract the new version 87/// * `args` - All args, to extract the new version
88async fn version(config: Cfg, args: Vec<String>) -> MLE<()> { 88async fn version(config: Cfg, args: Option<Vec<String>>, version_type: Option<MCVersionType>) -> MLE<()> {
89 let current_list = lists_get(config.clone(), config_get_current_list(config.clone())?)?; 89 let current_list = lists_get(config.clone(), config_get_current_list(config.clone())?)?;
90 90
91 lists_version(config.clone(), String::from(&current_list.id), String::from(&args[0]))?; 91 lists_version(config.clone(), String::from(&current_list.id), String::from(&args.unwrap()[0]))?;
92 //update the list & with -- args 92 //update the list & with -- args
93 cmd_update(config, vec![current_list], true, true, false).await 93 cmd_update(config, vec![current_list], true, true, false).await
94} 94}