| 1 | use clap::Parser; |
| 2 | |
| 3 | #[derive(Parser)] |
| 4 | #[command( |
| 5 | name = "rsgit", |
| 6 | version, |
| 7 | about = "A lightweight, blazingly fast Git web frontend written in Rust 🦀", |
| 8 | long_about = "rsgit is a minimalist web interface for scouting and browsing local Git repositories, viewing diffs, and managing user patches natively." |
| 9 | )] |
| 10 | pub struct Args { |
| 11 | /// The URL where the frontend is hosted (e.g., 127.0.0.1 or 0.0.0.0 for the public) |
| 12 | #[arg(short, long, value_name = "URL", default_value = "127.0.0.1")] |
| 13 | pub url: String, |
| 14 | |
| 15 | /// Port for the server to listen on |
| 16 | #[arg(short, long, value_name = "PORT", default_value_t = 80)] |
| 17 | pub port: u16, |
| 18 | |
| 19 | /// Repositories directory |
| 20 | #[arg(short, long, value_name = "DIR", default_value = "/srv/git")] |
| 21 | pub repos_dir: String, |
| 22 | |
| 23 | /// Install and enable the systemd service (/etc/systemd/system/git-rs.service) |
| 24 | #[arg(long)] |
| 25 | pub install_service: bool, |
| 26 | } |
