From ffe58dbb90bd223cc3f007b81c8bb9081d5e5a10 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 02:38:00 +0000 Subject: [PATCH] Cover -o token guards after value-taking flags Co-authored-by: Theo Browne --- apps/t3/src/cli.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/t3/src/cli.test.ts b/apps/t3/src/cli.test.ts index 1f60afa5f9..26bd846238 100644 --- a/apps/t3/src/cli.test.ts +++ b/apps/t3/src/cli.test.ts @@ -462,6 +462,12 @@ describe("parseCliOptions", () => { ); }); + it("treats -o after --backend-port as missing value", () => { + expect(() => parseCliOptions(["--backend-port", "-o"], {}, "/workspace")).toThrow( + "Missing value for --backend-port", + ); + }); + it("treats equals-style flag tokens after --backend-port as missing values", () => { expect(() => parseCliOptions(["--backend-port", "--web-port=7000"], {}, "/workspace"), @@ -504,6 +510,12 @@ describe("parseCliOptions", () => { ); }); + it("treats -o after --web-port as missing value", () => { + expect(() => parseCliOptions(["--web-port", "-o"], {}, "/workspace")).toThrow( + "Missing value for --web-port", + ); + }); + it("treats equals-style flag tokens after --web-port as missing values", () => { expect(() => parseCliOptions(["--web-port", "--backend-port=7000"], {}, "/workspace"), @@ -627,6 +639,12 @@ describe("parseCliOptions", () => { ); }); + it("treats -o after --cwd as missing value", () => { + expect(() => parseCliOptions(["--cwd", "-o"], {}, "/workspace")).toThrow( + "Missing value for --cwd", + ); + }); + it("treats end-of-options marker after --cwd as missing value", () => { expect(() => parseCliOptions(["--cwd", "--"], {}, "/workspace")).toThrow( "Missing value for --cwd",