fix(scripts): reject short flag gateway cpu values · openclaw/openclaw@52672c7
openclaw
·
2026-06-22
·
via Recent Commits to openclaw:main
Commit 52672c7
fix(scripts): reject short flag gateway cpu values
2 files changed
Lines changed: 4 additions & 2 deletions
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|
@@ -53,7 +53,7 @@ function parseArgs(argv) {
|
53 | 53 | const arg = args[index]; |
54 | 54 | const readValue = () => { |
55 | 55 | const value = args[index + 1]; |
56 | | -if (!value || value.startsWith("--")) { |
| 56 | +if (!value || value.startsWith("-")) { |
57 | 57 | throw new Error(`Missing value for ${arg}`); |
58 | 58 | } |
59 | 59 | index += 1; |
|
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|
@@ -105,7 +105,9 @@ describe("gateway CPU scenario guard", () => {
|
105 | 105 | "--cpu-core-warn", |
106 | 106 | "--hot-wall-warn-ms", |
107 | 107 | ]) { |
108 | | -expect(() => testing.parseArgs([flag, "--skip-qa"])).toThrow(`Missing value for ${flag}`); |
| 108 | +for (const value of ["--skip-qa", "-h"]) { |
| 109 | +expect(() => testing.parseArgs([flag, value])).toThrow(`Missing value for ${flag}`); |
| 110 | +} |
109 | 111 | } |
110 | 112 | }); |
111 | 113 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。
0 commit comments