snix_castore_http/
cli.rs

1use clap::Parser;
2use snix_castore::{B3Digest, utils::ServiceUrlsGrpc};
3
4#[derive(Parser)]
5#[command(author, version, about)]
6pub struct CliArgs {
7    /// The address to listen on
8    #[clap(flatten)]
9    pub listen_args: tokio_listener::ListenerAddressLFlag,
10    // The castore services addresses
11    #[clap(flatten)]
12    pub service_addrs: ServiceUrlsGrpc,
13    /// The root directory digest to serve.
14    #[arg(short, long, help = "The root directory digest to serve")]
15    pub root_directory: B3Digest,
16    /// The name of the file to serve if a client requests a directory e.g. index.html index.htm
17    #[arg(
18        short,
19        long,
20        help = "The name of the file to serve if a client requests a directory e.g. index.html index.htm"
21    )]
22    pub index_names: Vec<String>,
23    /// Whether a directory listing should be returned if a client requests a directory but none of the `index_names` matched
24    #[arg(
25        short,
26        long,
27        help = "Whether a directory listing should be returned if a client requests a directory but none of the `index_names` matched"
28    )]
29    pub auto_index: bool,
30}