1use anyhow::Result;
4use clap::{Parser, Subcommand};
5
6pub mod commands;
7pub mod config;
8pub mod git;
9pub mod help;
10
11#[derive(Parser)]
13#[command(name = "omni-dev")]
14#[command(about = "A comprehensive development toolkit", long_about = None)]
15#[command(version)]
16pub struct Cli {
17 #[command(subcommand)]
19 pub command: Commands,
20}
21
22#[derive(Subcommand)]
24pub enum Commands {
25 Git(git::GitCommand),
27 Commands(commands::CommandsCommand),
29 Config(config::ConfigCommand),
31 #[command(name = "help-all")]
33 HelpAll(help::HelpCommand),
34}
35
36impl Cli {
37 pub fn execute(self) -> Result<()> {
39 match self.command {
40 Commands::Git(git_cmd) => git_cmd.execute(),
41 Commands::Commands(commands_cmd) => commands_cmd.execute(),
42 Commands::Config(config_cmd) => config_cmd.execute(),
43 Commands::HelpAll(help_cmd) => help_cmd.execute(),
44 }
45 }
46}