use hermes_cli_components::impls::commands::start::StartRelayerArgs;
use hermes_cli_components::traits::command::CanRunCommand;
use hermes_cli_framework::command::CommandRunner;
use hermes_cli_framework::output::Output;
use crate::contexts::app::HermesApp;
use crate::Result;
pub mod bootstrap;
pub mod channel;
pub mod clear;
pub mod client;
pub mod connection;
pub mod query;
pub mod keys;
#[derive(Debug, clap::Parser)]
pub enum HermesCommand {
Start(StartRelayerArgs),
#[clap(subcommand)]
Client(client::ClientCommands),
#[clap(subcommand)]
Connection(connection::ConnectionCommands),
#[clap(subcommand)]
Channel(channel::ChannelCommands),
#[clap(subcommand)]
Query(query::QueryCommands),
#[clap(subcommand)]
Clear(clear::ClearCommands),
#[clap(subcommand)]
Keys(keys::KeysCmd),
#[clap(subcommand)]
Bootstrap(bootstrap::subcommand::BootstrapSubCommand),
}
impl CommandRunner<HermesApp> for HermesCommand {
async fn run(&self, app: &HermesApp) -> Result<Output> {
match self {
Self::Start(cmd) => app.run_command(cmd).await,
Self::Client(cmd) => cmd.run(app).await,
Self::Connection(cmd) => cmd.run(app).await,
Self::Channel(cmd) => cmd.run(app).await,
Self::Query(cmd) => cmd.run(app).await,
Self::Clear(cmd) => cmd.run(app).await,
Self::Keys(cmd) => cmd.run(app).await,
Self::Bootstrap(cmd) => app.run_command(cmd).await,
}
}
}