1use std::net::SocketAddr;
2
3use clap::Parser;
4
5#[derive(Parser, Debug, Clone)]
7#[command(author, version, about, long_about = None)]
8pub struct Args {
9 #[arg(long)]
10 pub http_listen_addr: SocketAddr,
11 #[arg(long, short = 'v')]
12 pub verbose: bool,
13 #[arg(long)]
14 pub backend_max_response_body_size: Option<usize>,
15}
16
17impl Args {
18 pub fn parse() -> Self {
19 Parser::parse()
20 }
21
22 pub fn backend_max_response_body_size(&self) -> usize {
23 self.backend_max_response_body_size.unwrap_or(1024 * 1024)
24 }
25}