index : gitrs
A lightweight web interface for browsing Git repositories, implemented in Rust
about summary refs log tree commit diff
gitrs / src / cli.rs
-rw-r--r-- blob ecf3d698d9e42c9b1d45cec48d63933ee848d668 917 bytes (plain)
1
use clap::Parser;
2
3
#[derive(Parser)]
4
#[command(
5
    name = "gitrs",
6
    version,
7
    about = "A lightweight, blazingly fast Git web frontend written in Rust 🦀",
8
    long_about = "gitrs 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/gitrs.service)
24
    #[arg(long)]
25
    pub install_service: bool,
26
}