rocket_cli/commands/
mod.rs1pub mod add;
2pub mod build;
3pub mod new;
4pub mod run;
5
6use clap::{Args, Subcommand};
7
8#[derive(Debug, Subcommand)]
9pub enum Command {
10 New(NewArgs),
12
13 Run,
15}
16
17#[derive(Debug, Args)]
18pub struct NewArgs {
19 pub name: Option<String>,
21
22 #[arg(long, help = "Initialize a git repository")]
24 pub git: bool,
25
26 #[arg(
28 long,
29 default_value = "minimal",
30 help = "Choose template: minimal, mongodb, postgres, mysql, mssql, sqlite"
31 )]
32 pub template: String,
33
34 #[arg(long, help = "List available templates")]
36 pub list: bool,
37}
38
39pub fn handle_command(cmd: Command) {
40 match cmd {
41 Command::New(args) => new::handle(args),
42 Command::Run => run::execute(),
43 }
44}