@devries-cameron20 / t3code Mirror · read-only / commits / c9a59a26bb
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 25, 17:15 UTC

Reject flag tokens as values in dev-runner arg parsing

- Treat `--` and `-...` tokens after value flags as missing values - Add regression test for `--state-dir --continue` to throw the expected error

Julius Marminge committed Feb 26, 2026 at 18:21 UTC c9a59a26bb85902b9b2e828e1f99cc0760105ae4
2 files changed +7 -1
scripts/dev-runner.mjs
+1 -1
@@ -131,7 +131,7 @@ export function parseDevRunnerArgs(rawArgs) {
131 let value = parsedFlag.value;
132 if (value === undefined) {
133 const next = args[index + 1];
134 - if (next === undefined) {
134 + if (next === undefined || next === "--" || next.startsWith("-")) {
135 throw new Error(`Missing value for --${parsedFlag.name}`);
136 }
137 value = next;
scripts/dev-runner.test.ts
+6
@@ -30,6 +30,12 @@ describe("parseDevRunnerArgs", () => {
30 it("throws when a value flag is missing its value", () => {
31 expect(() => parseDevRunnerArgs(["--state-dir"])).toThrow("Missing value for --state-dir");
32 });
33 +
34 + it("throws when a value flag is followed by another flag token", () => {
35 + expect(() => parseDevRunnerArgs(["--state-dir", "--continue"])).toThrow(
36 + "Missing value for --state-dir",
37 + );
38 + });
39 });
40
41 describe("createDevRunnerEnv", () => {