Skip to main content

tiny_proxy/cli/
args.rs

1use clap::Parser;
2
3/// Command line arguments for the proxy server
4#[derive(Parser, Debug)]
5#[command(author, version, about, long_about = None)]
6pub struct Cli {
7    /// Path to configuration file (Caddy-like format)
8    #[arg(short, long, default_value = "./file.caddy")]
9    pub config: String,
10
11    /// Address for proxy server to listen on
12    #[arg(short = 'a', long, default_value = "127.0.0.1:8080")]
13    pub addr: String,
14
15    /// Max concurrent connections (default: CPU cores * 256, use 0 for default)
16    #[arg(long, default_value_t = 0)]
17    pub max_concurrency: usize,
18
19    /// Enable management API server (requires 'api' feature)
20    #[arg(long)]
21    pub enable_api: bool,
22
23    /// Address for API server to listen on
24    #[arg(long, default_value = "127.0.0.1:8081")]
25    pub api_addr: String,
26}