hermes_cli/commands/
mod.rs1use hermes_cli_components::impls::commands::start::StartRelayerArgs;
2use hermes_cli_components::traits::command::CanRunCommand;
3use hermes_cli_framework::command::CommandRunner;
4use hermes_cli_framework::output::Output;
5
6use crate::contexts::app::HermesApp;
7use crate::Result;
8
9pub mod bootstrap;
10pub mod channel;
11pub mod clear;
12pub mod client;
13pub mod connection;
14pub mod query;
15
16pub mod keys;
17
18#[derive(Debug, clap::Parser)]
19pub enum HermesCommand {
20 Start(StartRelayerArgs),
22
23 #[clap(subcommand)]
25 Client(client::ClientCommands),
26
27 #[clap(subcommand)]
29 Connection(connection::ConnectionCommands),
30
31 #[clap(subcommand)]
33 Channel(channel::ChannelCommands),
34
35 #[clap(subcommand)]
37 Query(query::QueryCommands),
38
39 #[clap(subcommand)]
41 Clear(clear::ClearCommands),
42
43 #[clap(subcommand)]
45 Keys(keys::KeysCmd),
46
47 #[clap(subcommand)]
48 Bootstrap(bootstrap::subcommand::BootstrapSubCommand),
49}
50
51impl CommandRunner<HermesApp> for HermesCommand {
52 async fn run(&self, app: &HermesApp) -> Result<Output> {
53 match self {
54 Self::Start(cmd) => app.run_command(cmd).await,
55 Self::Client(cmd) => cmd.run(app).await,
56 Self::Connection(cmd) => cmd.run(app).await,
57 Self::Channel(cmd) => cmd.run(app).await,
58 Self::Query(cmd) => cmd.run(app).await,
59 Self::Clear(cmd) => cmd.run(app).await,
60 Self::Keys(cmd) => cmd.run(app).await,
61 Self::Bootstrap(cmd) => app.run_command(cmd).await,
62 }
63 }
64}