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
mod task;

use clap::Parser;
use fe_common::panic::install_panic_hook;
use task::Commands;

#[derive(Parser)]
#[clap(author, version, about, long_about = None)]
struct FelangCli {
    #[clap(subcommand)]
    command: Commands,
}

fn main() {
    install_panic_hook();

    let cli = FelangCli::parse();

    match cli.command {
        Commands::Build(arg) => {
            task::build(arg);
        }
        Commands::Check(arg) => {
            task::check(arg);
        }
        Commands::New(arg) => {
            task::create_new_project(arg);
        }
    }
}