fix(qa): reject duplicate sqlite bench controls

This commit is contained in:
Vincent Koc
2026-06-23 16:41:01 +02:00
parent 8c09419f20
commit bde5be874a
2 changed files with 13 additions and 0 deletions
+5
View File
@@ -134,12 +134,17 @@ function hasFlag(flag: string, argv = process.argv.slice(2)): boolean {
}
function validateArgs(argv: string[]): void {
const seenValueFlags = new Set<string>();
for (let index = 0; index < argv.length; index += 1) {
const arg = argv[index] ?? "";
if (BOOLEAN_FLAGS.has(arg)) {
continue;
}
if (VALUE_FLAGS.has(arg)) {
if (seenValueFlags.has(arg)) {
throw new CliUsageError(`${arg} was provided more than once`);
}
seenValueFlags.add(arg);
const value = argv[index + 1];
if (!value || value.startsWith("-")) {
throw new CliUsageError(`${arg} requires a value`);