Cover -o token guards after value-taking flags

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 02:38:00 +00:00
1 parent 6509eefec2
commit ffe58dbb90
1 file changed
+18
+18
View File
@@ -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",