gitfetch_rs/cli/
args.rs

1use clap::Parser;
2
3#[derive(Parser, Debug)]
4#[command(name = "gitfetch-rs")]
5#[command(
6  about = "A neofetch-style CLI tool for git.\nOriginal Python CLI is https://github.com/Matars/gitfetch\nSupports GitHub, GitLab, Gitea, and Sourcehut."
7)]
8#[command(version)]
9pub struct Cli {
10  /// Username to fetch stats for
11  pub username: Option<String>,
12
13  // ===== General Options =====
14  /// Bypass cache and fetch fresh data
15  #[arg(long, help_heading = "General Options")]
16  pub no_cache: bool,
17
18  /// Clear the cache and exit
19  #[arg(long, help_heading = "General Options")]
20  pub clear_cache: bool,
21
22  /// Show version and check for updates
23  #[arg(long, short = 'V', help_heading = "General Options")]
24  pub version: bool,
25
26  /// Change the configured git provider
27  #[arg(long, help_heading = "General Options")]
28  pub change_provider: bool,
29
30  /// Fetch data specific to current local repo (requires .git folder)
31  #[arg(long, help_heading = "General Options")]
32  pub local: bool,
33
34  // ===== Visual Options =====
35  /// Enable spaced layout
36  #[arg(long, help_heading = "Visual Options")]
37  pub spaced: bool,
38
39  /// Disable spaced layout
40  #[arg(long, help_heading = "Visual Options")]
41  pub not_spaced: bool,
42
43  /// Custom character for contribution blocks (e.g., '■', '█')
44  #[arg(long, help_heading = "Visual Options")]
45  pub custom_box: Option<String>,
46
47  /// Show only the contribution graph
48  #[arg(long, help_heading = "Visual Options")]
49  pub graph_only: bool,
50
51  /// Set custom width for contribution graph
52  #[arg(long, help_heading = "Visual Options")]
53  pub width: Option<usize>,
54
55  /// Set custom height for contribution graph
56  #[arg(long, help_heading = "Visual Options")]
57  pub height: Option<usize>,
58
59  /// Display text as contribution graph pattern (simulation only)
60  #[arg(long, help_heading = "Visual Options")]
61  pub text: Option<String>,
62
63  /// Display one or more predefined shapes as contribution graph (simulation only). Provide multiple shapes: --shape kitty,kitty
64  #[arg(long, value_delimiter = ',', help_heading = "Visual Options")]
65  pub shape: Option<Vec<String>>,
66
67  /// Show git timeline graph instead of contribution graph
68  #[arg(long, help_heading = "Visual Options")]
69  pub graph_timeline: bool,
70
71  // ===== Visibility =====
72  /// Hide month/date labels on contribution graph
73  #[arg(long, help_heading = "Visibility")]
74  pub no_date: bool,
75
76  /// Hide achievements section
77  #[arg(long, help_heading = "Visibility")]
78  pub no_achievements: bool,
79
80  /// Hide languages section
81  #[arg(long, help_heading = "Visibility")]
82  pub no_languages: bool,
83
84  /// Hide issues section
85  #[arg(long, help_heading = "Visibility")]
86  pub no_issues: bool,
87
88  /// Hide pull requests section
89  #[arg(long, help_heading = "Visibility")]
90  pub no_pr: bool,
91
92  /// Hide account information section
93  #[arg(long, help_heading = "Visibility")]
94  pub no_account: bool,
95
96  /// Hide contribution grid/graph
97  #[arg(long, help_heading = "Visibility")]
98  pub no_grid: bool,
99}