use anyhow::Result;
use clap::{Parser, Subcommand};
pub mod ai;
pub mod atlassian;
pub mod commands;
pub mod config;
pub mod git;
pub mod help;
#[derive(Parser)]
#[command(name = "omni-dev")]
#[command(about = "A comprehensive development toolkit", long_about = None)]
#[command(version)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
Ai(ai::AiCommand),
Git(git::GitCommand),
Commands(commands::CommandsCommand),
Config(config::ConfigCommand),
Atlassian(atlassian::AtlassianCommand),
#[command(name = "help-all")]
HelpAll(help::HelpCommand),
}
impl Cli {
pub async fn execute(self) -> Result<()> {
match self.command {
Commands::Ai(ai_cmd) => ai_cmd.execute().await,
Commands::Git(git_cmd) => git_cmd.execute().await,
Commands::Commands(commands_cmd) => commands_cmd.execute(),
Commands::Atlassian(cmd) => cmd.execute().await,
Commands::Config(config_cmd) => config_cmd.execute(),
Commands::HelpAll(help_cmd) => help_cmd.execute(),
}
}
}