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
use clap::Parser;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct Args {
/// Add a shift to the database (default date is today's)
#[arg(short, long, default_value_t = false)]
pub add: bool,
/// Remove a shift from the datatbase (default date is today's)
#[arg(short, long, default_value_t = false)]
pub remove: bool,
/// List all shifts from this month (or from another month if specified)
#[arg(short, long, default_value_t = false)]
pub list: bool,
/// List all shifts from the database
#[arg(short = 'L', long, default_value_t = false)]
pub list_all: bool,
/// Create or change a config file with input
#[arg(short, long, default_value_t = false)]
pub change_config: bool,
/// Shows you the current config file
#[arg(short = 'C', long, default_value_t = false)]
pub show_config: bool,
/// Shows statistics about all your shifts
#[arg(short, long, default_value_t = false)]
pub stats: bool,
/// Specify time when adding a shift in this format 10:00
#[arg(short, long)]
pub time: Option<String>,
/// Specify date when adding removing or listing shifts in this format day/month/year or
/// month/year in --list
#[arg(short, long)]
pub date: Option<String>,
/// Specify premium for shifts in percentage
#[arg(short, long, default_value_t = 0.)]
pub preimium: f32,
}
pub fn get_args() -> Args {
Args::parse()
}