fix(cli): parse --data-dir flag after command name
This commit is contained in:
parent
590e429630
commit
30e366adc1
|
|
@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue