1use clap::{Parser, Subcommand};
4
5#[derive(Parser)]
6#[command(name = "crank")]
7#[command(author, version, about, long_about = None)]
8#[command(
9 about = "crank - A build tool for Playdate game development",
10 long_about = "crank is a command-line build tool for Playdate game development, \
11 inspired by Cargo. It provides project scaffolding, build automation, \
12 and development tools to streamline your workflow."
13)]
14pub struct Cli {
15 #[command(subcommand)]
16 pub command: Commands,
17}
18
19#[derive(Subcommand)]
20pub enum Commands {
21 #[command(visible_alias = "n")]
23 New {
24 name: String,
26
27 path: Option<String>,
29
30 #[arg(short, long, default_value = "lua-basic")]
32 template: Option<String>,
33 },
34
35 #[command(visible_alias = "b")]
37 Build {
38 #[arg(short, long)]
40 release: bool,
41
42 #[arg(short, long)]
44 verbose: bool,
45 },
46
47 #[command(visible_alias = "r")]
49 Run {
50 #[arg(short, long)]
52 release: bool,
53 },
54
55 #[command(visible_alias = "w")]
57 Watch {
58 #[arg(long)]
60 no_run: bool,
61 },
62
63 #[command(visible_alias = "t")]
65 Test {
66 #[arg(short, long)]
68 filter: Option<String>,
69 },
70
71 #[command(visible_alias = "c")]
73 Clean,
74}