mod connection;
pub use connection::QueryConnection;
mod clients;
pub use clients::QueryClients;
mod connections;
pub use connections::QueryConnections;
mod channel;
pub use channel::QueryChannel;
mod channels;
pub use channels::QueryChannels;
mod packet;
use hermes_cli_components::impls::commands::queries::client::QueryClientSubCommand;
use hermes_cli_components::traits::command::CanRunCommand;
use hermes_cli_framework::command::CommandRunner;
use hermes_cli_framework::output::Output;
pub use packet::PacketCommands;
use crate::contexts::app::HermesApp;
use crate::Result;
#[derive(Debug, clap::Subcommand)]
pub enum QueryCommands {
Clients(QueryClients),
Connections(QueryConnections),
Channels(QueryChannels),
#[clap(subcommand)]
Client(QueryClientSubCommand),
#[clap(subcommand)]
Connection(QueryConnection),
#[clap(subcommand)]
Channel(QueryChannel),
#[clap(subcommand)]
Packet(PacketCommands),
}
impl CommandRunner<HermesApp> for QueryCommands {
async fn run(&self, app: &HermesApp) -> Result<Output> {
match self {
Self::Client(cmd) => app.run_command(cmd).await,
Self::Clients(cmd) => cmd.run(app).await,
Self::Connection(cmd) => cmd.run(app).await,
Self::Connections(cmd) => cmd.run(app).await,
Self::Channels(cmd) => cmd.run(app).await,
Self::Channel(cmd) => cmd.run(app).await,
Self::Packet(cmd) => cmd.run(app).await,
}
}
}