-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathcli.rs
More file actions
101 lines (85 loc) · 3.19 KB
/
cli.rs
File metadata and controls
101 lines (85 loc) · 3.19 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
use std::path::PathBuf;
use clap_derive::{
Parser,
Subcommand,
};
#[derive(Debug, Parser)]
#[command(
version = env!("CARGO_PKG_VERSION"),
)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
}
#[derive(Debug, Subcommand)]
pub enum Command {
/// Compile a goboscript project to `.sb3`
#[command()]
Build {
#[arg(short, long)]
/// Project directory, if not given, the current directory is used.
input: Option<PathBuf>,
#[arg(short, long)]
/// Output file, if not given, it will be the project directory's name + `.sb3`
output: Option<PathBuf>,
#[arg(short, long)]
release: bool,
},
/// Run a goboscript file using the experimental interpreter.
#[command()]
Run {
#[arg(short, long)]
input: PathBuf,
},
/// Create a new goboscript project with a blank backdrop, a main sprite with a
/// blank costume.
#[command()]
New {
/// Name of directory to create new project, if not given, the current directory
/// is used. If this is a path to an existing directory, it must be empty.
#[arg(short = 'n', long)]
name: Option<PathBuf>,
/// Version of the standard library to use. Defaults to bleeding-edge.
#[arg(short = 's', long)]
std: Option<String>,
/// (alias: --fps) Custom frame rate, used by TurboWarp.
#[arg(short = 'f', long, alias = "fps")]
frame_rate: Option<u64>,
/// (alias: --clones) Custom maximum number of clones allowed, used by TurboWarp.
/// Use `--max-clones inf` for infinite clones.
#[arg(short = 'c', long, alias = "clones")]
max_clones: Option<f64>,
/// (alias: --limitless) Disable miscellaneous limits, used by TurboWarp.
#[arg(short = 'l', long, alias = "limitless")]
no_miscellaneous_limits: bool,
/// (alias: --offscreen) Disable sprite fencing, used by TurboWarp.
#[arg(short = 'o', long, alias = "offscreen")]
no_sprite_fencing: bool,
/// (alias: --interpolate) Enable frame interpolation, used by TurboWarp.
#[arg(short = 'i', long, alias = "interpolate")]
frame_interpolation: bool,
/// (alias: --hqpen) Enable high quality pen, used by TurboWarp.
#[arg(short = 'q', long, alias = "hqpen")]
high_quality_pen: bool,
/// (alias: --width) Custom stage width, used by TurboWarp.
#[arg(short = 'W', long, alias = "width")]
stage_width: Option<u64>,
/// (alias: --height) Custom stage height, used by TurboWarp.
#[arg(short = 'H', long, alias = "height")]
stage_height: Option<u64>,
},
/// Format a goboscript project.
#[command()]
Fmt {
/// Project directory or file, if not given, the current directory is used.
#[arg(short, long)]
input: Option<PathBuf>,
},
/// Generate completions for a shell.
#[command()]
Completions {
/// The shell to generate the completions for.
#[arg(value_enum)]
shell: clap_complete_command::Shell,
},
}