mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(scripts): reject short flag CI timing limits
This commit is contained in:
@@ -416,7 +416,7 @@ function consumePositiveIntFlag(args, index, flag) {
|
||||
return null;
|
||||
}
|
||||
const rawValue = args[index + 1];
|
||||
if (!rawValue || rawValue.startsWith("--")) {
|
||||
if (!rawValue || rawValue.startsWith("-")) {
|
||||
throw new Error(`${flag} requires a value`);
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -263,7 +263,13 @@ describe("scripts/ci-run-timings.mjs", () => {
|
||||
});
|
||||
|
||||
it("rejects missing monitor limits instead of treating flags as values", () => {
|
||||
for (const args of [["--limit"], ["--limit", "--recent", "4"], ["--recent"]]) {
|
||||
for (const args of [
|
||||
["--limit"],
|
||||
["--limit", "--recent", "4"],
|
||||
["--limit", "-h"],
|
||||
["--recent"],
|
||||
["--recent", "-h"],
|
||||
]) {
|
||||
expect(() => parseRunTimingArgs(args)).toThrow("requires a value");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user