Parent [>]
1//! Command-line arguments parsed at startup via clap.
2
3use std::path::PathBuf;
4
5use clap::Parser;
6
7use teak::theme::Theme;
8
9/// Command-line arguments parsed via clap at startup.
10#[derive(Parser)]
11pub struct Args {
12    /// Path to the directory containing bare git repositories.
13    #[arg(long, default_value = ".")]
14    pub root: PathBuf,
15
16    /// Hostname shown in the breadcrumb and used to build clone URLs.
17    #[arg(long)]
18    pub hostname: Option<String>,
19
20    /// Path prefix prepended before the repository name in SSH clone URLs
21    /// (e.g. `repos/` or `/srv/git/`).
22    #[arg(long)]
23    pub ssh_prefix: Option<String>,
24
25    /// Built-in color theme.
26    #[arg(long, default_value = "auto")]
27    pub theme: Theme,
28
29    /// Path to a custom CSS file with theme variable overrides; takes
30    /// precedence over --theme if provided.
31    #[arg(long)]
32    pub theme_file: Option<PathBuf>,
33
34    /// Port to listen on.
35    #[arg(long, default_value = "3000")]
36    pub port: u16,
37
38    /// Address to bind the HTTP server to.
39    #[arg(long, default_value = "0.0.0.0")]
40    pub bind: String,
41
42    /// URL path prefix when served behind a reverse proxy (e.g. `/git`).
43    /// All generated URLs will be prefixed with this value.
44    #[arg(long)]
45    pub base_url: Option<String>,
46
47    /// Path to a custom favicon file (SVG or ICO). Overrides the default
48    /// commit-icon favicon.
49    #[arg(long)]
50    pub favicon: Option<PathBuf>,
51}