From ed263af5a933110585497c63867335bf84eaf987 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 29 Nov 2024 14:31:40 +0000 Subject: [PATCH] feat: parse command line --- src/lib.rs | 13 +++++++++++++ src/main.rs | 11 ++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6755e19..6326c1b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,3 +32,16 @@ impl Default for Ctx { } } } + +#[cfg_attr(test, mutants::skip)] +pub async fn run(_ctx: Ctx) -> color_eyre::Result<()> { + color_eyre::install()?; + + let commands = Commands::parse(); + match commands.command { + Command::Init => todo!("init"), + Command::Check => todo!("check"), + Command::Import => todo!("import"), + }; + // Ok(()) +} diff --git a/src/main.rs b/src/main.rs index 703e44e..0e1c72f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,17 +3,14 @@ use std::path::PathBuf; use color_eyre::Result; -use trello_to_deck::Ctx; +use trello_to_deck::{run, Ctx}; #[tokio::main] #[cfg_attr(test, mutants::skip)] async fn main() -> Result<()> { - color_eyre::install()?; - - let _ctx = Ctx { + run(Ctx { fs: kxio::fs::new(PathBuf::default()), net: kxio::net::new(), - }; - - Ok(()) + }) + .await }