fix(scripts): reject short flag startup memory paths · openclaw/openclaw@03bc600
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -49,7 +49,7 @@ function readNonEmptyEnv(name) {
|
49 | 49 | |
50 | 50 | function readRequiredPathOption(argv, index, flag) { |
51 | 51 | const value = argv[index + 1]; |
52 | | -if (!value || value.startsWith("--")) { |
| 52 | +if (!value || value.startsWith("-")) { |
53 | 53 | throw new Error(`${flag} requires a path`); |
54 | 54 | } |
55 | 55 | return value; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -107,8 +107,10 @@ describe("check-cli-startup-memory", () => {
|
107 | 107 | for (const args of [ |
108 | 108 | ["--json"], |
109 | 109 | ["--json", "--summary"], |
| 110 | +["--json", "-h"], |
110 | 111 | ["--summary"], |
111 | 112 | ["--summary", "--json"], |
| 113 | +["--summary", "-h"], |
112 | 114 | ]) { |
113 | 115 | expect(() => testing.parseArgs(args)).toThrow(/--(?:json|summary) requires a path/u); |
114 | 116 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。