diff --git a/scripts/openclaw-performance-source-summary.mjs b/scripts/openclaw-performance-source-summary.mjs index 5cb772fb1d3..3e505ffad06 100644 --- a/scripts/openclaw-performance-source-summary.mjs +++ b/scripts/openclaw-performance-source-summary.mjs @@ -8,7 +8,7 @@ import { pathToFileURL } from "node:url"; function readOptionValue(argv, index, optionName) { const value = argv[index + 1]; - if (!value || value.startsWith("--")) { + if (!value || value.startsWith("-")) { throw new Error(`${optionName} requires a value`); } return value; diff --git a/test/scripts/openclaw-performance-source-summary.test.ts b/test/scripts/openclaw-performance-source-summary.test.ts index c8de48d5df4..4e431dc2ea4 100644 --- a/test/scripts/openclaw-performance-source-summary.test.ts +++ b/test/scripts/openclaw-performance-source-summary.test.ts @@ -134,6 +134,7 @@ describe("parseArgs", () => { for (const flag of ["--source-dir", "--baseline-source-dir", "--output"]) { expect(() => parseArgs([flag])).toThrow(`${flag} requires a value`); expect(() => parseArgs([flag, ""])).toThrow(`${flag} requires a value`); + expect(() => parseArgs([flag, "-h"])).toThrow(`${flag} requires a value`); expect(() => parseArgs([flag, "--source-dir", "reports/current"])).toThrow( `${flag} requires a value`, );