Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/cli.zig
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ const astc_cmd = @import("astc/cmd.zig");
const audit = @import("cli/audit.zig");
const migrate = @import("cli/migrate.zig");
const check = @import("cli/check.zig");
const plugins = @import("cli/plugins.zig");
const doctor = @import("cli/doctor.zig");
const sdl_provision = @import("cli/sdl_provision.zig");

const Command = enum { generate, build, run, init_cmd, add_cmd, install_cmd, upgrade_cmd, update_cmd, clean_cmd, ios_cmd, android_cmd, wasm_cmd, help_cmd, version, targets, assembler_cmd, test_cmd, pack_cmd, astc_cmd, audit_cmd, migrate_cmd, doctor_cmd, check_cmd, toolchain_cmd, status_cmd };
const Command = enum { generate, build, run, init_cmd, add_cmd, install_cmd, upgrade_cmd, update_cmd, clean_cmd, ios_cmd, android_cmd, wasm_cmd, help_cmd, version, targets, assembler_cmd, test_cmd, pack_cmd, astc_cmd, audit_cmd, migrate_cmd, doctor_cmd, check_cmd, plugins_cmd, toolchain_cmd, status_cmd };

const SceneResult = enum { not_scene, parsed, needs_next, err };

Expand Down Expand Up @@ -810,6 +811,11 @@ pub fn main(proc_init: std.process.Init) !void {
} else if (std.mem.eql(u8, first, "check")) {
parsed_args.command = .check_cmd;
try collectExtraArgs(&args, &parsed_args);
} else if (std.mem.eql(u8, first, "plugins")) {
// `labelle plugins [dir]` — list attached plugins with their
// version + license/author provenance (labelle-cli#300).
parsed_args.command = .plugins_cmd;
try collectExtraArgs(&args, &parsed_args);
} else if (std.mem.eql(u8, first, "toolchain")) {
// `labelle toolchain list|which` — managed Zig introspection (cli#279).
parsed_args.command = .toolchain_cmd;
Expand Down Expand Up @@ -936,6 +942,7 @@ pub fn main(proc_init: std.process.Init) !void {
.audit_cmd => return audit.cmdAudit(allocator, parsed_args.extra_args[0..parsed_args.extra_count]),
.migrate_cmd => return migrate.cmdMigrate(allocator, parsed_args.extra_args[0..parsed_args.extra_count]),
.check_cmd => return check.cmdCheck(allocator, parsed_args.extra_args[0..parsed_args.extra_count]),
.plugins_cmd => return plugins.cmdPlugins(allocator, parsed_args.extra_args[0..parsed_args.extra_count]),
.doctor_cmd => return doctor.cmdDoctor(allocator, parsed_args.extra_args[0..parsed_args.extra_count]),
.assembler_cmd => return handleAssemblerCmd(allocator, parsed_args.extra_args[0..parsed_args.extra_count]),
.toolchain_cmd => return handleToolchainCmd(allocator, parsed_args.extra_args[0..parsed_args.extra_count]),
Expand Down Expand Up @@ -1890,6 +1897,12 @@ pub const MigrateDeleteTopLevelKeyBlockCommentSpec = migrate.DeleteTopLevelKeyBl
// walks into it (mirrors the audit/migrate re-exports above).
pub const CheckParseCheckArgsSpec = check.ParseCheckArgsSpec;

// Surface the `labelle plugins` listing specs (labelle-cli#300) so
// `zspec.runAll(@This())` walks into the plugin.labelle reader tests and
// the table renderer tests.
pub const PluginsReadPluginMetaSpec = plugins.ReadPluginMetaSpec;
pub const PluginsRenderTableSpec = plugins.RenderTableSpec;

// Surface the machine-readable update/upgrade `--check`/`--json` specs
// (labelle-cli#276) so `zspec.runAll(@This())` walks into them.
pub const UpdateCheckCliStatusSpec = update_check.CliStatusSpec;
Expand Down
2 changes: 2 additions & 0 deletions src/cli/help.zig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub fn printHelp() void {
\\ audit unification [dir] Pre-flight check for the unified scene/prefab loader (RFC #560)
\\ migrate unified [dir] [--dry-run] Auto-fix legacy unified-format patterns (RFC #594 / engine#592)
\\ check [dir] Lint packs for §6 convention violations (Packs RFC)
\\ plugins [dir] List attached plugins with version, license, and author
\\ doctor [dir] Check desktop build requirements (SDL2, Zig) and report fixes
\\ help Show this help
\\ version Show CLI version
Expand Down Expand Up @@ -70,6 +71,7 @@ pub fn printHelp() void {
\\ labelle audit unification ../my-game
\\ labelle migrate unified
\\ labelle migrate unified --dry-run
\\ labelle plugins
\\
, .{project_config.CLI_VERSION});
}
Expand Down
Loading
Loading