1use crate::{commands, error::Result};
2use clap::{Parser, Subcommand};
3use std::path::PathBuf;
4
5#[derive(Parser)]
6#[command(author, version, about = "Git toolkit powered by LLMs")]
7pub struct Cli {
8 #[command(subcommand)]
9 command: Commands,
10}
11
12#[derive(Subcommand)]
13pub enum Commands {
14 #[command(alias = "p")]
16 Parse {
17 #[arg(default_value = ".")]
19 path: Option<PathBuf>,
20
21 #[arg(short, long)]
23 output_dir: Option<PathBuf>,
24
25 #[arg(short, long)]
27 include: Option<String>,
28
29 #[arg(short = 'x', long)]
31 ignore: Option<String>,
32 },
33}
34
35impl Cli {
36 pub async fn execute(self) -> Result<()> {
37 match self.command {
38 Commands::Parse {
39 path,
40 output_dir,
41 include,
42 ignore,
43 } => {
44 commands::parse::execute(path, output_dir, include, ignore).await?;
45 }
46 }
47 Ok(())
48 }
49}