omni_dev/cli/
mod.rs

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