From 9517271bbb93546ac8cdbe420ad143abea37df13 Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Wed, 18 Feb 2026 13:26:18 -0500 Subject: [PATCH] fix(cli): remove unreachable code and unused Command enum - Fix duplicate 'i' case in Command.fromString that was unreachable - Remove unused Command enum entirely (dispatch uses inline comparisons) - Build verified: zig build --release=fast --- cli/src/main.zig | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/cli/src/main.zig b/cli/src/main.zig index 6cb15c8..4db218d 100644 --- a/cli/src/main.zig +++ b/cli/src/main.zig @@ -1,47 +1,6 @@ const std = @import("std"); const colors = @import("utils/colors.zig"); -// Optimized command dispatch -const Command = enum { - jupyter, - init, - sync, - requeue, - queue, - status, - monitor, - cancel, - prune, - watch, - dataset, - experiment, - validate, - info, - unknown, - - fn fromString(str: []const u8) Command { - if (str.len == 0) return .unknown; - - // Fast path for common commands - switch (str[0]) { - 'j' => if (std.mem.eql(u8, str, "jupyter")) return .jupyter, - 'i' => if (std.mem.eql(u8, str, "init")) return .init, - 'i' => if (std.mem.eql(u8, str, "info")) return .info, - 's' => if (std.mem.eql(u8, str, "sync")) return .sync else if (std.mem.eql(u8, str, "status")) return .status, - 'q' => if (std.mem.eql(u8, str, "queue")) return .queue, - 'm' => if (std.mem.eql(u8, str, "monitor")) return .monitor, - 'c' => if (std.mem.eql(u8, str, "cancel")) return .cancel, - 'p' => if (std.mem.eql(u8, str, "prune")) return .prune, - 'w' => if (std.mem.eql(u8, str, "watch")) return .watch, - 'd' => if (std.mem.eql(u8, str, "dataset")) return .dataset, - 'e' => if (std.mem.eql(u8, str, "experiment")) return .experiment, - 'v' => if (std.mem.eql(u8, str, "validate")) return .validate, - else => return .unknown, - } - return .unknown; - } -}; - pub fn main() !void { // Initialize colors based on environment colors.initColors();