mithril_client_cli/commands/cardano_db/
mod.rs1mod download;
3mod list;
4mod show;
5
6pub use download::*;
7pub use list::*;
8pub use show::*;
9
10use crate::CommandContext;
11use clap::Subcommand;
12use mithril_client::MithrilResult;
13
14#[derive(Subcommand, Debug, Clone)]
16pub enum CardanoDbCommands {
17 #[clap(subcommand)]
19 Snapshot(CardanoDbSnapshotCommands),
20
21 #[clap(arg_required_else_help = true)]
23 Download(CardanoDbDownloadCommand),
24}
25
26#[derive(Subcommand, Debug, Clone)]
28pub enum CardanoDbSnapshotCommands {
29 #[clap(arg_required_else_help = false)]
31 List(CardanoDbListCommand),
32
33 #[clap(arg_required_else_help = true)]
35 Show(CardanoDbShowCommand),
36}
37
38impl CardanoDbCommands {
39 pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
41 match self {
42 Self::Download(cmd) => cmd.execute(config_builder).await,
43 Self::Snapshot(cmd) => cmd.execute(config_builder).await,
44 }
45 }
46}
47
48impl CardanoDbSnapshotCommands {
49 pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
51 match self {
52 Self::List(cmd) => cmd.execute(config_builder).await,
53 Self::Show(cmd) => cmd.execute(config_builder).await,
54 }
55 }
56}