diff options
Diffstat (limited to 'src/commands/list.rs')
-rw-r--r-- | src/commands/list.rs | 9 |
1 files changed, 6 insertions, 3 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 | } |