diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/list.rs | 9 | ||||
-rw-r--r-- | src/db.rs | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/commands/list.rs b/src/commands/list.rs index a02f8b1..3998cce 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs | |||
@@ -23,7 +23,10 @@ pub async fn list(config: Cfg, input: Input) -> Result<(), Box<dyn std::error::E | |||
23 | change(config, input.args) | 23 | change(config, input.args) |
24 | }, | 24 | }, |
25 | Subcmd::Remove => { | 25 | Subcmd::Remove => { |
26 | remove(config, input.args.ok_or("")?) | 26 | match remove(config, input.args.ok_or("")?) { |
27 | Ok(..) => Ok(()), | ||
28 | Err(e) => Err(Box::new(e)) | ||
29 | } | ||
27 | }, | 30 | }, |
28 | Subcmd::Version => { | 31 | Subcmd::Version => { |
29 | match version(config, Some(input.args.ok_or("NO_VERSION")?), Some(MCVersionType::Release)).await { | 32 | match version(config, Some(input.args.ok_or("NO_VERSION")?), Some(MCVersionType::Release)).await { |
@@ -72,10 +75,10 @@ fn change(config: Cfg, args: Option<Vec<String>>) -> Result<(), Box<dyn std::err | |||
72 | } | 75 | } |
73 | } | 76 | } |
74 | 77 | ||
75 | fn remove(config: Cfg, args: Vec<String>) -> Result<(), Box<dyn std::error::Error>> { | 78 | fn remove(config: Cfg, args: Vec<String>) -> MLE<()> { |
76 | match args.len() { | 79 | match args.len() { |
77 | 1 => lists_remove(config, String::from(&args[0])), | 80 | 1 => lists_remove(config, String::from(&args[0])), |
78 | 2.. => Err(Box::new(Error::new(ErrorKind::InvalidInput, "TOO_MANY_ARGUMENTS"))), | 81 | 2.. => Err(MLError::new(ErrorType::ArgumentCountError, "TOO_MANY_ARGUMENTS")), |
79 | _ => panic!("list arguments should never be zero or lower"), | 82 | _ => panic!("list arguments should never be zero or lower"), |
80 | } | 83 | } |
81 | } | 84 | } |
@@ -361,7 +361,7 @@ pub fn lists_insert(config: Cfg, id: String, mc_version: String, mod_loader: Mod | |||
361 | Ok(()) | 361 | Ok(()) |
362 | } | 362 | } |
363 | 363 | ||
364 | pub fn lists_remove(config: Cfg, id: String) -> Result<(), Box<dyn std::error::Error>> { | 364 | pub fn lists_remove(config: Cfg, id: String) -> MLE<()> { |
365 | let data = devdir(format!("{}/data.db", config.data).as_str()); | 365 | let data = devdir(format!("{}/data.db", config.data).as_str()); |
366 | let connection = Connection::open(data)?; | 366 | let connection = Connection::open(data)?; |
367 | 367 | ||