2024-12-08 17:23:54 +00:00
|
|
|
//
|
|
|
|
use color_eyre::eyre::eyre;
|
|
|
|
use color_eyre::Result;
|
|
|
|
|
|
|
|
use crate::FullCtx;
|
|
|
|
|
|
|
|
pub(crate) trait Execute {
|
2024-12-15 20:07:34 +00:00
|
|
|
async fn execute(self, ctx: &FullCtx) -> Result<()>;
|
2024-12-08 17:23:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Execute for crate::Command {
|
2024-12-15 20:07:34 +00:00
|
|
|
async fn execute(self, ctx: &FullCtx) -> Result<()> {
|
2024-12-08 17:23:54 +00:00
|
|
|
match self {
|
|
|
|
Self::Init => Err(eyre!("Config file already exists. Not overwriting it.")),
|
|
|
|
Self::Check => crate::check::run(ctx).await,
|
|
|
|
Self::Import => todo!(), //crate::import::run(ctx).await,
|
|
|
|
Self::Trello(cmd) => cmd.execute(ctx).await,
|
|
|
|
Self::Nextcloud(cmd) => cmd.execute(ctx).await,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|