From 5f17ee8a337530fc357949e64dc69d3362e620d1 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 01:28:02 +0000 Subject: [PATCH] Expand end-of-options positional parsing coverage Co-authored-by: Theo Browne --- apps/t3/src/cli.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/t3/src/cli.test.ts b/apps/t3/src/cli.test.ts index 44370dca75..13df12dbb2 100644 --- a/apps/t3/src/cli.test.ts +++ b/apps/t3/src/cli.test.ts @@ -166,6 +166,11 @@ describe("parseCliOptions", () => { expect(options.launchCwd).toBe(path.resolve("/workspace", "-project")); }); + it("treats known flag tokens as positional values after end-of-options marker", () => { + const options = parseCliOptions(["--", "--help"], {}, "/workspace"); + expect(options.launchCwd).toBe(path.resolve("/workspace", "--help")); + }); + it("throws when end-of-options marker has no positional value", () => { expect(() => parseCliOptions(["--"], {}, "/workspace")).toThrow("Missing value for [path]"); }); @@ -176,6 +181,12 @@ describe("parseCliOptions", () => { ); }); + it("throws when end-of-options marker has extra values after flag-like path", () => { + expect(() => parseCliOptions(["--", "--help", "apps/t3"], {}, "/workspace")).toThrow( + "Unexpected positional argument: apps/t3", + ); + }); + it("keeps ports unlocked when using defaults", () => { const options = parseCliOptions([], {}, "/workspace"); expect(options.backendPortLocked).toBe(false);