{"record":{"id":"6790e92d29233f4a","repo":"Egonex-AI/Understand-Anything","slug":"unknown-option-arg","errorCode":null,"errorMessage":"Unknown option: ${arg}","messagePattern":"Unknown option: (.+?)","errorType":"validation","errorClass":"CliUsageError","httpStatus":null,"severity":"error","filePath":"scripts/lib/large-repo-benchmark.mjs","lineNumber":238,"sourceCode":"      i += 1;\n      continue;\n    }\n    if (arg.startsWith('--label=')) {\n      label = arg.slice('--label='.length);\n      continue;\n    }\n    if (arg === '--concurrency') {\n      const raw = takeValue(argv, i, '--concurrency');\n      concurrency = parseConcurrency(raw);\n      i += 1;\n      continue;\n    }\n    if (arg.startsWith('--concurrency=')) {\n      concurrency = parseConcurrency(arg.slice('--concurrency='.length));\n      continue;\n    }\n    if (arg.startsWith('-')) {\n      throw new CliUsageError(`Unknown option: ${arg}`);\n    }\n    if (repoValue) {\n      throw new CliUsageError(`Unexpected positional argument: ${arg}`);\n    }\n    repoValue = arg;\n  }\n\n  if (help) return { help: true };\n  if (!repoValue) throw new CliUsageError('A repository path is required');\n  if (outputValue === null || outputValue.trim() === '') {\n    throw new CliUsageError('--output is required and must be non-empty');\n  }\n  if (!Number.isInteger(concurrency) || concurrency < 1 || concurrency > 32) {\n    throw new CliUsageError('--concurrency must be an integer between 1 and 32');\n  }\n\n  const repoRoot = resolve(cwd, repoValue);\n  if (!existsSync(repoRoot)) {","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/Egonex-AI/Understand-Anything/blob/32944829e7a63a9fa9c55d811d7f98a9530c6a6a/scripts/lib/large-repo-benchmark.mjs#L220-L256","documentation":"CliUsageError thrown by parseArgs when an argument token starts with '-' but does not match any recognised flag (--help/-h, --keep-artifacts, --repo, --output/-o, --label, --concurrency, and their =-forms). It catches typos and unsupported options early with a clear message naming the offending token.","triggerScenarios":"Passing a misspelled flag like '--ouput', a short form that does not exist like '-x', a single-dash long option like '-repo', or any future/unsupported option.","commonSituations":"Typos in flag names; using a flag from a different version of the tool; copy-pasting options from documentation for a different command; confusion between single-dash and double-dash conventions.","solutions":["Run with --help to see the accepted flags and their exact spelling.","Correct the flag name (e.g. --ouput -> --output).","Remove the unsupported option if it is not needed for this run.","If you expect the option to be supported, upgrade the tool to a version that provides it."],"exampleFix":"# before\nnode benchmark-large-repo.mjs myrepo --ouput out.json\n# after\nnode benchmark-large-repo.mjs myrepo --output out.json","handlingStrategy":"validation","validationCode":"const KNOWN = new Set(['--help','-h','--keep-artifacts','--repo','--output','-o','--label','--concurrency']);\nfunction isKnownFlag(arg: string): boolean {\n  return KNOWN.has(arg) || KNOWN.has(arg.split('=')[0]);\n}","typeGuard":null,"tryCatchPattern":"try { const opts = parseArgs(argv); } catch (e) { if ((e as Error).name === 'CliUsageError') { console.error(e.message); console.error(helpText()); process.exit(2); } throw e; }","preventionTips":["Run with --help to confirm exact flag spellings.","Validate flags against a known set before invoking parseArgs in wrappers."],"tags":["benchmark","cli","argument-parsing"],"backgroundTag":null,"analyzedSha":"32944829e7a63a9fa9c55d811d7f98a9530c6a6a","analyzedAt":"2026-08-12T10:25:44.261Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}