mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(qa): reject duplicate gateway smoke options
This commit is contained in:
@@ -49,9 +49,14 @@ function usage(): string {
|
||||
}
|
||||
|
||||
function validateArgs(argv: readonly string[]): void {
|
||||
const seen = new Set<string>();
|
||||
for (let index = 0; index < argv.length; index += 1) {
|
||||
const arg = argv[index] ?? "";
|
||||
if (BOOLEAN_FLAGS.has(arg)) {
|
||||
if (seen.has(arg)) {
|
||||
throw new GatewaySmokeArgError(`${arg} was provided more than once`);
|
||||
}
|
||||
seen.add(arg);
|
||||
continue;
|
||||
}
|
||||
if (VALUE_FLAGS.has(arg)) {
|
||||
@@ -59,6 +64,10 @@ function validateArgs(argv: readonly string[]): void {
|
||||
if (!value || value.startsWith("-")) {
|
||||
throw new GatewaySmokeArgError(`${arg} requires a value`);
|
||||
}
|
||||
if (seen.has(arg)) {
|
||||
throw new GatewaySmokeArgError(`${arg} was provided more than once`);
|
||||
}
|
||||
seen.add(arg);
|
||||
index += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user