fix(cli): parse --data-dir flag after command name

This commit is contained in:
Voxis 2026-02-16 16:11:17 +01:00
parent 590e429630
commit 30e366adc1
Signed by: markus
GPG Key ID: 07DDBEA3CBDC090A
1 changed files with 2 additions and 2 deletions

View File

@ -30,9 +30,9 @@ pub fn main() !void {
} else if (std.mem.eql(u8, args[i], "--port") and i + 1 < args.len) { } 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; port_override = std.fmt.parseInt(u16, args[i + 1], 10) catch null;
i += 1; 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; cmd_idx = i;
break;
} }
} }