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
49
50
51
52
53
54
55
56
57
pub mod fetch;
pub mod stats;
use clap::Clap;
#[derive(Clap)]
#[clap(version = "1.0", author = "Nathaniel Ledford <nate@nateledford.com>")]
pub struct Opts {
#[clap(subcommand)]
pub subcmd: SubCommand,
}
#[derive(Clap)]
pub enum SubCommand {
Fetch(Fetch),
Stats(Stats),
}
#[derive(Clap)]
pub struct Fetch {
#[clap(short)]
pub username: Option<String>,
#[clap(short)]
pub page: Option<i32>,
#[clap(short)]
pub limit: Option<i32>,
#[clap(short)]
pub from: Option<i64>,
#[clap(short)]
pub to: Option<i64>,
#[clap(short = 'n', takes_value = false)]
pub new_file: bool,
#[clap(long, takes_value = false)]
pub current_day: bool,
#[clap(long)]
pub file_format: Option<String>,
}
#[derive(Clap)]
pub struct Stats {
#[clap(short)]
pub username: Option<String>,
}