mithril_client_cli/commands/cardano_db_v2/
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)]
16#[command(about = "[unstable] Cardano db v2 management (alias: cdbv2)")]
17pub enum CardanoDbV2Commands {
18 #[clap(subcommand)]
20 Snapshot(CardanoDbV2SnapshotCommands),
21
22 #[clap(arg_required_else_help = true)]
24 Download(CardanoDbV2DownloadCommand),
25}
26
27#[derive(Subcommand, Debug, Clone)]
29pub enum CardanoDbV2SnapshotCommands {
30 #[clap(arg_required_else_help = false)]
32 List(CardanoDbListCommand),
33
34 #[clap(arg_required_else_help = true)]
36 Show(CardanoDbShowCommand),
37}
38
39impl CardanoDbV2Commands {
40 pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
42 match self {
43 Self::Snapshot(cmd) => cmd.execute(config_builder).await,
44 Self::Download(cmd) => cmd.execute(config_builder).await,
45 }
46 }
47}
48
49impl CardanoDbV2SnapshotCommands {
50 pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
52 match self {
53 Self::List(cmd) => cmd.execute(config_builder).await,
54 Self::Show(cmd) => cmd.execute(config_builder).await,
55 }
56 }
57}