fix(qa): reject short flag UX evidence paths · openclaw/openclaw@648ef73
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -60,7 +60,17 @@ function readOptionValue(argv: readonly string[], index: number, arg: string) {
|
60 | 60 | } |
61 | 61 | |
62 | 62 | function isHelpRequest(argv: readonly string[]) { |
63 | | -return argv.length === 1 && (argv[0] === "--help" || argv[0] === "-h"); |
| 63 | +for (let index = 0; index < argv.length; index += 1) { |
| 64 | +const arg = argv[index]; |
| 65 | +if (arg === "--artifact-base" || arg === "--repo-root") { |
| 66 | +index += 1; |
| 67 | +continue; |
| 68 | +} |
| 69 | +if (arg === "--help" || arg === "-h") { |
| 70 | +return true; |
| 71 | +} |
| 72 | +} |
| 73 | +return false; |
64 | 74 | } |
65 | 75 | |
66 | 76 | function parseOptions(argv: readonly string[]): ProducerOptions { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,6 +34,16 @@ describe("QA UX Matrix evidence producer CLI", () => {
|
34 | 34 | expect(result.stderr).toBe(""); |
35 | 35 | }); |
36 | 36 | |
| 37 | +it("prints help after boolean options without consuming valued option slots", () => { |
| 38 | +const result = runCli("--skip-visual-proof", "--help"); |
| 39 | + |
| 40 | +expect(result.status).toBe(0); |
| 41 | +expect(result.stdout).toContain( |
| 42 | +"Usage: node --import tsx scripts/qa/ux-matrix-evidence-producer.ts", |
| 43 | +); |
| 44 | +expect(result.stderr).toBe(""); |
| 45 | +}); |
| 46 | + |
37 | 47 | it("reports invalid args without a Node stack trace", () => { |
38 | 48 | const result = runCli("--wat"); |
39 | 49 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。