mod download;
mod list;
mod show;
pub use download::*;
pub use list::*;
pub use show::*;
use crate::CommandContext;
use clap::Subcommand;
use mithril_client::MithrilResult;
#[derive(Subcommand, Debug, Clone)]
pub enum CardanoDbCommands {
#[clap(subcommand)]
Snapshot(CardanoDbSnapshotCommands),
#[clap(arg_required_else_help = true)]
Download(CardanoDbDownloadCommand),
}
#[derive(Subcommand, Debug, Clone)]
pub enum CardanoDbSnapshotCommands {
#[clap(arg_required_else_help = false)]
List(CardanoDbListCommand),
#[clap(arg_required_else_help = true)]
Show(CardanoDbShowCommand),
}
impl CardanoDbCommands {
pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
match self {
Self::Download(cmd) => cmd.execute(config_builder).await,
Self::Snapshot(cmd) => cmd.execute(config_builder).await,
}
}
}
impl CardanoDbSnapshotCommands {
pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
match self {
Self::List(cmd) => cmd.execute(config_builder).await,
Self::Show(cmd) => cmd.execute(config_builder).await,
}
}
}