fix(scripts): reject short flag startup memory paths

This commit is contained in:
Vincent Koc
2026-06-21 22:06:04 +02:00
parent 8102d5ebc3
commit 03bc600e67
2 changed files with 3 additions and 1 deletions

View File

@@ -49,7 +49,7 @@ function readNonEmptyEnv(name) {
function readRequiredPathOption(argv, index, flag) {
const value = argv[index + 1];
if (!value || value.startsWith("--")) {
if (!value || value.startsWith("-")) {
throw new Error(`${flag} requires a path`);
}
return value;

View File

@@ -107,8 +107,10 @@ describe("check-cli-startup-memory", () => {
for (const args of [
["--json"],
["--json", "--summary"],
["--json", "-h"],
["--summary"],
["--summary", "--json"],
["--summary", "-h"],
]) {
expect(() => testing.parseArgs(args)).toThrow(/--(?:json|summary) requires a path/u);
}