use std::fmt::Debug;
use crate::commands::contract::{deploy, id};
use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
pub struct Root {
#[clap(subcommand)]
cmd: Cmd,
}
#[derive(Subcommand, Debug)]
enum Cmd {
Wrap(deploy::asset::Cmd),
Id(id::asset::Cmd),
}
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error(transparent)]
Wrap(#[from] deploy::asset::Error),
#[error(transparent)]
Id(#[from] id::asset::Error),
}
impl Root {
pub async fn run(&self) -> Result<(), Error> {
match &self.cmd {
Cmd::Wrap(wrap) => wrap.run().await?,
Cmd::Id(id) => id.run()?,
}
Ok(())
}
}