diff --git a/src/trello/boards.rs b/src/trello/boards.rs deleted file mode 100644 index e6569be..0000000 --- a/src/trello/boards.rs +++ /dev/null @@ -1,34 +0,0 @@ -// -use clap::Parser; - -use crate::{execute::Execute, p, FullCtx}; - -#[derive(Parser, Debug)] -pub(crate) enum TrelloBoardCommand { - List { - #[clap(long, action = clap::ArgAction::SetTrue)] - dump: bool, - }, -} - -impl Execute for TrelloBoardCommand { - async fn execute(self, ctx: FullCtx) -> color_eyre::Result<()> { - match self { - Self::List { dump } => list(ctx, dump).await, - } - } -} - -pub(crate) async fn list(ctx: FullCtx, dump: bool) -> color_eyre::Result<()> { - let api_result = ctx.trello_client().boards().await; - if dump { - p!(ctx.prt, "{}", api_result.text); - } else { - let mut boards = api_result.result?; - boards.sort_by(|a, b| a.name.cmp(&b.name)); - boards.into_iter().for_each(|board| { - p!(ctx.prt, "{}:{}", board.id, board.name); - }); - } - Ok(()) -} diff --git a/src/trello/mod.rs b/src/trello/mod.rs index 9518521..5f636d6 100644 --- a/src/trello/mod.rs +++ b/src/trello/mod.rs @@ -20,7 +20,6 @@ use crate::{ pub(crate) mod attachment; pub(crate) mod board; -pub(crate) mod boards; pub(crate) mod card; pub(crate) mod client; pub(crate) mod member;