refactor: rearrange command dispatcher
Some checks failed
Test / build (map[name:nightly]) (push) Successful in 1m58s
Test / build (map[name:stable]) (push) Successful in 1m44s
Release Please / Release-plz (push) Failing after 15s

This commit is contained in:
Paul Campbell 2024-12-08 07:24:44 +00:00
parent ecef639318
commit 6bac32bb7b

View file

@ -150,24 +150,35 @@ pub async fn run(ctx: Ctx) -> color_eyre::Result<()> {
Command::Init => Err(eyre!("Config file already exists. Not overwriting it.")),
Command::Check => check::run(ctx).await,
Command::Import => todo!("import"),
Command::Trello(TrelloCommand::Board(TrelloBoardCommand::List { dump })) => {
trello::boards::list(ctx, dump).await
}
Command::Nextcloud(NextcloudCommand::Board(NextcloudBoardCommand::List {
dump,
})) => nextcloud::board::list(ctx, dump).await,
Command::Nextcloud(NextcloudCommand::Stack(NextcloudStackCommand::List {
dump,
})) => nextcloud::stack::list(ctx, dump).await,
Command::Nextcloud(NextcloudCommand::Card(NextcloudCardCommand::List {
dump,
stack_id,
})) => nextcloud::card::list(ctx, dump, stack_id.into()).await,
Command::Nextcloud(NextcloudCommand::Card(NextcloudCardCommand::Get {
dump,
stack_id,
card_id,
})) => nextcloud::card::get(ctx, dump, stack_id.into(), card_id.into()).await,
Command::Trello(trello) => match trello {
TrelloCommand::Board(board) => match board {
TrelloBoardCommand::List { dump } => {
nextcloud::board::list(ctx, dump).await
}
},
},
Command::Nextcloud(nextcloud) => match nextcloud {
NextcloudCommand::Board(board) => match board {
NextcloudBoardCommand::List { dump } => {
nextcloud::board::list(ctx, dump).await
}
},
NextcloudCommand::Stack(stack) => match stack {
NextcloudStackCommand::List { dump } => {
nextcloud::stack::list(ctx, dump).await
}
},
NextcloudCommand::Card(card) => match card {
NextcloudCardCommand::List { dump, stack_id } => {
nextcloud::card::list(ctx, dump, stack_id.into()).await
}
NextcloudCardCommand::Get {
dump,
stack_id,
card_id,
} => nextcloud::card::get(ctx, dump, stack_id.into(), card_id.into()).await,
},
},
}
}
}