cli.rs
⎇
Raw
1use std::path::PathBuf;
2
3use clap::Parser;
4
5#[derive(Parser, Debug)]
6#[command(
7 name = "filebrowser-ng",
8 about = "A simple, noob-friendly web file browser",
9 version
10)]
11pub struct Cli {
12 /// Root folder the server has access to (required).
13 /// All user folders and shares are relative to this.
14 #[arg(long)]
15 pub root: PathBuf,
16
17 /// Path to the SQLite database file (required).
18 #[arg(long)]
19 pub db: PathBuf,
20
21 /// Port to listen on.
22 #[arg(long, default_value_t = 8080)]
23 pub port: u16,
24
25 /// Address to bind. Use 0.0.0.0 to expose beyond localhost.
26 #[arg(long, default_value = "127.0.0.1")]
27 pub bind: String,
28
29 /// Assume the server runs behind a TLS-terminating reverse proxy
30 /// (sets the `Secure` attribute on the session cookie).
31 #[arg(long)]
32 pub https: bool,
33}
34