From 2acf52a63b6dcd24ca826b99061bf7a51a9230b1 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sat, 31 Jan 2026 00:41:48 -0600 Subject: [PATCH] fix(cli): add proper flag validation for check script --- scripts/check.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/check.ts b/scripts/check.ts index c052d99..d95707e 100644 --- a/scripts/check.ts +++ b/scripts/check.ts @@ -8,7 +8,17 @@ import { c, elapsed, isStderrTTY } from "./lib/fmt"; import { run, runPiped, spawnCollect, raceInOrder, type CollectResult } from "./lib/proc"; import { existsSync, statSync, readdirSync, writeFileSync, rmSync } from "fs"; -const fix = process.argv.includes("--fix") || process.argv.includes("-f"); +const args = process.argv.slice(2); +let fix = false; + +for (const arg of args) { + if (arg === "-f" || arg === "--fix") { + fix = true; + } else { + console.error(`Unknown flag: ${arg}`); + process.exit(1); + } +} // --------------------------------------------------------------------------- // Fix path: format + clippy fix, then fall through to verification