mithril_client_cli/commands/tools/
mod.rs1mod snapshot_converter;
7
8pub use snapshot_converter::*;
9
10use anyhow::anyhow;
11use clap::Subcommand;
12use mithril_client::MithrilResult;
13
14#[derive(Subcommand, Debug, Clone)]
16#[command(about = "[unstable] Tools commands")]
17pub enum ToolsCommands {
18 #[clap(subcommand, name = "utxo-hd")]
20 UTxOHD(UTxOHDCommands),
21}
22
23impl ToolsCommands {
24 pub async fn execute(&self) -> MithrilResult<()> {
26 match self {
27 Self::UTxOHD(cmd) => cmd.execute().await,
28 }
29 }
30}
31
32#[derive(Subcommand, Debug, Clone)]
34pub enum UTxOHDCommands {
35 #[clap(arg_required_else_help = false)]
37 SnapshotConverter(SnapshotConverterCommand),
38}
39
40impl UTxOHDCommands {
41 pub async fn execute(&self) -> MithrilResult<()> {
43 match self {
44 Self::SnapshotConverter(cmd) => {
45 if cfg!(target_os = "linux") && cfg!(target_arch = "aarch64") {
46 return Err(anyhow!(
47 "'snapshot-converter' command is not supported on Linux ARM"
48 ));
49 }
50 cmd.execute().await
51 }
52 }
53 }
54}