From 30e366adc165faf1a981266e9a1a3dcfb40223f2 Mon Sep 17 00:00:00 2001 From: Voxis Date: Mon, 16 Feb 2026 16:11:17 +0100 Subject: [PATCH] fix(cli): parse --data-dir flag after command name --- capsule-core/src/main.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/capsule-core/src/main.zig b/capsule-core/src/main.zig index fe0c4f7..fe0398b 100644 --- a/capsule-core/src/main.zig +++ b/capsule-core/src/main.zig @@ -30,9 +30,9 @@ pub fn main() !void { } else if (std.mem.eql(u8, args[i], "--port") and i + 1 < args.len) { port_override = std.fmt.parseInt(u16, args[i + 1], 10) catch null; i += 1; - } else { + } else if (cmd_idx == 1 and !std.mem.startsWith(u8, args[i], "--")) { + // First non-flag argument is the command cmd_idx = i; - break; } }