use gcli::{App, Command, async_trait, clap::Parser};
#[derive(Debug, Parser)]
pub enum SubCommand {
#[clap(flatten)]
GCliCommands(Command),
Ping,
}
#[derive(Debug, Parser)]
pub struct MyGCli {
#[clap(subcommand)]
command: SubCommand,
}
#[async_trait]
impl App for MyGCli {
async fn exec(&self) -> anyhow::Result<()> {
match &self.command {
SubCommand::GCliCommands(command) => command.exec(self).await,
SubCommand::Ping => {
println!("pong");
Ok(())
}
}
}
}
#[tokio::main]
async fn main() -> color_eyre::Result<()> {
MyGCli::parse().run().await
}