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
43
44
45
46
47
48
use clap::Parser;
#[derive(Parser)]
pub struct Opts {
#[clap(subcommand)]
pub subcommand: SubCommand,
}
#[derive(Parser)]
pub enum SubCommand {
Serve(ServeCommand),
Dev,
}
#[derive(Parser)]
pub struct DeployCommand {
pub service_id: Option<String>,
}
#[derive(Parser)]
pub struct LoginCommand {
#[clap(short, long)]
pub token: Option<String>,
#[clap(short, long)]
pub clear: bool,
}
#[derive(Parser)]
pub struct ServeCommand {
pub module: String,
#[clap(short, long, default_value = "8080")]
pub port: u32,
#[clap(short = 'i', long, default_value = "30")]
pub heartbeat_interval: u64,
#[clap(short = 't', long, default_value = "120")]
pub heartbeat_timeout: u64,
}