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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(
name = "esmeril",
version,
about = "Scaffold, check and inspect Roblox Luau projects"
)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
/// Emit machine-readable JSON to stdout instead of the table
#[arg(global = true, long, id = "json_out")]
pub json: bool,
}
#[derive(Subcommand)]
pub enum Commands {
/// Scaffold a modern Roblox project: Rojo, Selene, StyLua, Aftman, Wally and CI
Init(InitArgs),
/// Inspect a project: tooling configs, structure and an A-F grade
Check(CheckArgs),
/// Audit wally.toml dependencies against the package registry
Deps(DepsArgs),
/// Bump wally.toml requirements to the latest published versions
Update(UpdateArgs),
/// Run the formatter and linter on the source tree
Fmt(FmtArgs),
/// Check the project and build it with Rojo
Build(BuildArgs),
/// Check the local toolchain: rojo, selene, stylua, wally and aftman
Doctor,
/// Generate shell completion scripts
Completions {
/// Shell to generate for: bash, zsh, fish, powershell, elvish
#[arg(value_enum)]
shell: clap_complete::Shell,
},
}
#[derive(clap::Args)]
pub struct InitArgs {
/// Directory to create; defaults to the current directory name
pub name: Option<String>,
/// Use Luau language mode Strict instead of NonStrict
#[arg(long)]
pub strict: bool,
/// Scaffold a library package (for publishing to Wally) instead of a game
#[arg(long)]
pub lib: bool,
/// Overwrite files when the target directory is not empty
#[arg(long)]
pub force: bool,
}
#[derive(clap::Args)]
pub struct CheckArgs {
/// Project directory to inspect; defaults to the current directory
#[arg(default_value = ".")]
pub path: String,
/// Create the standard files that are missing instead of only reporting
#[arg(long)]
pub fix: bool,
/// Print the report as a markdown table instead of the text report
#[arg(long)]
pub markdown: bool,
}
#[derive(clap::Args)]
pub struct DepsArgs {
/// Project directory to inspect; defaults to the current directory
#[arg(default_value = ".")]
pub path: String,
/// Use only the local index cache; fail when a package is not cached
#[arg(long)]
pub offline: bool,
}
#[derive(clap::Args)]
pub struct FmtArgs {
/// Project directory to inspect; defaults to the current directory
#[arg(default_value = ".")]
pub path: String,
/// Only report problems, do not format
#[arg(long)]
pub check: bool,
}
#[derive(clap::Args)]
pub struct BuildArgs {
/// Project directory to inspect; defaults to the current directory
#[arg(default_value = ".")]
pub path: String,
/// Output file name (defaults to game.rbxl or lib.rbxm)
#[arg(short, long)]
pub output: Option<String>,
}
#[derive(clap::Args)]
pub struct UpdateArgs {
/// Project directory to inspect; defaults to the current directory
#[arg(default_value = ".")]
pub path: String,
/// Write the new requirements to wally.toml (dry-run by default)
#[arg(long)]
pub write: bool,
/// Use only the local index cache; fail when a package is not cached
#[arg(long)]
pub offline: bool,
}