repo_analyzer/
cli.rs

1use clap::Parser;
2use std::path::PathBuf;
3
4#[derive(Parser, Debug)]
5#[command(
6    name = "repo-analyzer",
7    about = "A tool to analyze GitHub repositories",
8    version,
9    author
10)]
11pub struct Cli {
12    /// Path to the repository to analyze
13    #[arg(short, long, required_unless_present = "remote_url")]
14    pub repo_path: Option<PathBuf>,
15
16    /// Output format (text, json, html)
17    #[arg(short = 'f', long, default_value = "html")]
18    pub output_format: String,
19
20    /// Output file path
21    #[arg(short, long)]
22    pub output: Option<String>,
23
24    /// Include detailed commit history
25    #[arg(short, long, default_value = "false")]
26    pub detailed_history: bool,
27
28    /// Number of top contributors to show
29    #[arg(short, long, default_value = "5")]
30    pub top_contributors: usize,
31
32    /// Clone and analyze a remote repository (provide URL)
33    #[arg(short = 'u', long)]
34    pub remote_url: Option<String>,
35
36    /// Depth of commit history to analyze (0 for all)
37    #[arg(long, default_value = "0")]
38    pub history_depth: usize,
39
40    /// Upload report to cloud storage
41    #[arg(short = 'U', long)]
42    pub upload: bool,
43}