ahqstore_cli_rs/app/
mod.rs

1use chalk_rs::Chalk;
2use lazy_static::lazy_static;
3
4mod build;
5mod create;
6mod help;
7pub mod shared;
8
9mod update;
10
11lazy_static! {
12  static ref INFO: Chalk = {
13    let mut chalk = Chalk::new();
14    chalk.blue().bold();
15    chalk
16  };
17  static ref WARN: Chalk = {
18    let mut chalk = Chalk::new();
19    chalk.yellow().bold();
20    chalk
21  };
22  static ref ERR: Chalk = {
23    let mut chalk = Chalk::new();
24    chalk.red().bold();
25    chalk
26  };
27}
28
29pub fn start(args: Vec<String>, gh: bool) {
30  update::check_updates();
31
32  if args.len() >= 1 {
33    match args[0].as_str() {
34      "create" => create::create(args.len() > 1 && (&args[1] == "--force" || &args[1] == "-f")),
35      "build" => build::build_config(false, gh),
36      "upload" => build::build_config(true, gh),
37      "help" => println!("{}", help::main_help()),
38      a => println!("{}", help::not_found(a)),
39    }
40  } else {
41    println!("{}", help::main_help());
42  }
43}