From 28706f6edf10a135a67334d7035948bab4064bef Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Sun, 18 Dec 2022 23:11:50 +0100 Subject: dl add clean & all-lists; start of io --- src/input.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/input.rs') diff --git a/src/input.rs b/src/input.rs index 41b0c29..ffc1213 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1,5 +1,5 @@ use std::env; -use crate::{config::Cfg, list, modification, update, setup, download, error::{MLError, ErrorType, MLE}}; +use crate::{config::Cfg, list, modification, update, setup, download, io, error::{MLError, ErrorType, MLE}}; #[derive(Debug, Clone, PartialEq, Eq)] pub struct Input { @@ -77,7 +77,8 @@ pub enum Cmd { List, Update, Download, - Setup + Setup, + Io } impl Cmd { @@ -88,6 +89,7 @@ impl Cmd { "update" => Self::Update, "download" => Self::Download, "setup" => Self::Setup, + "io" => Self::Io, _ => return Err(MLError::new(ErrorType::ArgumentError, "Unknown command")) }; Ok(cmd) @@ -98,7 +100,9 @@ impl Cmd { pub enum Subcmd { Add, Remove, - Change + Change, + Export, + Import, } impl Subcmd { @@ -107,6 +111,8 @@ impl Subcmd { "add" => Self::Add, "remove" => Self::Remove, "change" => Self::Change, + "export" => Self::Export, + "import" => Self::Import, _ => return Err(MLError::new(ErrorType::ArgumentError, "SUBCMD_NOT_FOUND")) }; Ok(cmd) @@ -136,6 +142,9 @@ pub async fn get_input(config: Cfg) -> Result<(), Box> { }, Cmd::Download => { download(config, input).await + }, + Cmd::Io => { + io(config, input) } } } -- cgit v1.2.3