fix(scripts): reject short flag performance summary paths · openclaw/openclaw@8102d5e
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,7 @@ import { pathToFileURL } from "node:url";
|
8 | 8 | |
9 | 9 | function readOptionValue(argv, index, optionName) { |
10 | 10 | const value = argv[index + 1]; |
11 | | -if (!value || value.startsWith("--")) { |
| 11 | +if (!value || value.startsWith("-")) { |
12 | 12 | throw new Error(`${optionName} requires a value`); |
13 | 13 | } |
14 | 14 | return value; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -134,6 +134,7 @@ describe("parseArgs", () => {
|
134 | 134 | for (const flag of ["--source-dir", "--baseline-source-dir", "--output"]) { |
135 | 135 | expect(() => parseArgs([flag])).toThrow(`${flag} requires a value`); |
136 | 136 | expect(() => parseArgs([flag, ""])).toThrow(`${flag} requires a value`); |
| 137 | +expect(() => parseArgs([flag, "-h"])).toThrow(`${flag} requires a value`); |
137 | 138 | expect(() => parseArgs([flag, "--source-dir", "reports/current"])).toThrow( |
138 | 139 | `${flag} requires a value`, |
139 | 140 | ); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。