-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathargument.rs
42 lines (33 loc) · 1.22 KB
/
argument.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use clap::Parser;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct Argument {
/// Bind server `host:port` to listen incoming connections on it
#[arg(short, long)]
pub bind: String,
/// Filepath to server identity in PKCS (PFX) format
#[arg(short, long)]
pub identity: String,
/// Passphrase to unlock encrypted identity
#[arg(short, long, default_value_t = String::new())]
pub password: String,
/// Uploads directory (e.g. `public` directory)
#[arg(short, long, default_value_t = String::from("public"))]
pub directory: String,
/// Uploads max size limit in bytes (unlimited by default)
#[arg(short, long)]
pub size: Option<usize>,
/// Buffer chunk size (`1024` by default)
#[arg(short, long, default_value_t = 1024)]
pub chunk: usize,
/// Uploads MIME type allowed (comma separated, all by default)
/// * based on headers
#[arg(short, long)]
pub mime: Option<String>,
/// Redirection URL on request handle complete (e.g. `gemini://localhost`)
#[arg(short, long)]
pub redirect: Option<String>,
/// Welcome page filename (in gemtext format)
#[arg(short, long)]
pub welcome: Option<String>,
}