aboutsummaryrefslogtreecommitdiff
path: root/apps/cassiopeia/src/bin/cass.rs
blob: cb799d18ccc53645a4d97c8f8fef265ac55ea6b8 (plain)
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
58
59
60
61
62
use cassiopeia::{self as cass, meta};
use clap::{App, Arg, SubCommand};

fn main() {
    let app = App::new(meta::NAME)
        .version(meta::VERSION)
        .about(meta::ABOUT)
        .after_help("To learn more on how to use cassiopeia, check out the documentation \
                     at https://git.spacekookie.de/kookienomicon/tree/apps/cassiopeia
If you want to report a bug, please do so on my mailing list: lists.sr.ht/~spacekookie/public-inbox")
        .author(meta::AUTHOR)
        .setting(clap::AppSettings::SubcommandRequiredElseHelp)
        .global_settings(&[
            clap::AppSettings::DisableHelpSubcommand,
            clap::AppSettings::VersionlessSubcommands,
        ])
        .arg(
            Arg::with_name(meta::ARG_FILE)
                .short("f")
                .long("file")
                .help(meta::ARG_FILE_ABOUT)
                .default_value("./time.cass")
                .takes_value(true),
        )
        .subcommand(
            SubCommand::with_name(meta::CMD_START)
                .about(meta::CMD_START_ABOUT)
                .arg(Arg::with_name(meta::ARG_ROUNDING).help(meta::ARG_ROUNDING_ABOUT)),
        )
        .subcommand(
            SubCommand::with_name(meta::CMD_STOP)
                .about(meta::CMD_STOP_ABOUT)
                .arg(Arg::with_name(meta::ARG_ROUNDING).help(meta::ARG_ROUNDING_ABOUT)),
        )
        .subcommand(
            SubCommand::with_name(meta::CMD_INVOICE)
                .about(meta::CMD_INVOICE_ABOUT)
                .arg(
                    Arg::with_name(meta::ARG_CLIENT)
                        .short("c")
                        .long("client")
                        .takes_value(true)
                        .help(meta::ARG_CLIENT_ABOUT),
                )
                .arg(
                    Arg::with_name(meta::ARG_PROJECT)
                        .short("p")
                        .long("project")
                        .takes_value(true)
                        .help(meta::ARG_PROJECT_ABOUT),
                )
                .arg(
                    Arg::with_name(meta::ARG_GEN_YAML)
                        .short("g")
                        .long("gen")
                        .help(meta::ARG_GEN_YAML_ABOUT),
                ),
        )
        .get_matches();

    let file = cass::load_file("/home/projects/clients/nyantec-nix-workshops/time.cass");
}