omni_dev/cli/
mod.rs

1//! CLI interface for omni-dev
2
3use anyhow::Result;
4use clap::{Parser, Subcommand};
5
6pub mod commands;
7pub mod git;
8pub mod help;
9
10/// omni-dev: A comprehensive development toolkit
11#[derive(Parser)]
12#[command(name = "omni-dev")]
13#[command(about = "A comprehensive development toolkit", long_about = None)]
14#[command(version)]
15pub struct Cli {
16    /// The main command to execute
17    #[command(subcommand)]
18    pub command: Commands,
19}
20
21/// Main command categories
22#[derive(Subcommand)]
23pub enum Commands {
24    /// Git-related operations
25    Git(git::GitCommand),
26    /// Command template management
27    Commands(commands::CommandsCommand),
28    /// Display comprehensive help for all commands
29    #[command(name = "help-all")]
30    HelpAll(help::HelpCommand),
31}
32
33impl Cli {
34    /// Execute the CLI command
35    pub fn execute(self) -> Result<()> {
36        match self.command {
37            Commands::Git(git_cmd) => git_cmd.execute(),
38            Commands::Commands(commands_cmd) => commands_cmd.execute(),
39            Commands::HelpAll(help_cmd) => help_cmd.execute(),
40        }
41    }
42}