//! Command-line arguments parsed at startup via clap.

use std::path::PathBuf;

use clap::Parser;

use temp_name::theme::Theme;

/// Command-line arguments parsed via clap at startup.
#[derive(Parser)]
pub struct Args {
    /// Path to the directory containing bare git repositories.
    #[arg(long, default_value = ".")]
    pub root: PathBuf,

    /// Hostname shown in the breadcrumb and used to build clone URLs.
    #[arg(long)]
    pub hostname: Option<String>,

    /// Path prefix prepended before the repository name in SSH clone URLs
    /// (e.g. `repos/` or `/srv/git/`).
    #[arg(long)]
    pub ssh_prefix: Option<String>,

    /// Built-in color theme.
    #[arg(long, default_value = "auto")]
    pub theme: Theme,

    /// Path to a custom CSS file with theme variable overrides; takes
    /// precedence over --theme if provided.
    #[arg(long)]
    pub theme_file: Option<PathBuf>,

    /// Port to listen on.
    #[arg(long, default_value = "3000")]
    pub port: u16,

    /// Address to bind the HTTP server to.
    #[arg(long, default_value = "0.0.0.0")]
    pub bind: String,

    /// URL path prefix when served behind a reverse proxy (e.g. `/git`).
    /// All generated URLs will be prefixed with this value.
    #[arg(long)]
    pub base_url: Option<String>,

    /// Path to a custom favicon file (SVG or ICO). Overrides the default
    /// commit-icon favicon.
    #[arg(long)]
    pub favicon: Option<PathBuf>,
}
