{"record":{"id":"285181be96d1afcd","repo":"Egonex-AI/Understand-Anything","slug":"output-is-required-and-must-be-non-empty","errorCode":null,"errorMessage":"--output is required and must be non-empty","messagePattern":"--output is required and must be non-empty","errorType":"validation","errorClass":"CliUsageError","httpStatus":null,"severity":"error","filePath":"scripts/lib/large-repo-benchmark.mjs","lineNumber":249,"sourceCode":"      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)) {\n    throw new CliUsageError(`Repository path does not exist: ${repoValue}`);\n  }\n  if (!statSync(repoRoot).isDirectory()) {\n    throw new CliUsageError(`Repository path is not a directory: ${repoValue}`);\n  }\n\n  const outputPath = resolve(cwd, outputValue);\n  const markdownPath = resolve(\n    cwd,\n    outputPath.toLowerCase().endsWith('.json')\n      ? `${outputPath.slice(0, -'.json'.length)}.md`","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/Egonex-AI/Understand-Anything/blob/32944829e7a63a9fa9c55d811d7f98a9530c6a6a/scripts/lib/large-repo-benchmark.mjs#L231-L267","documentation":"CliUsageError thrown by parseArgs when outputValue is null (no --output/-o flag seen) or empty after trim. The output path is required because the benchmark must write its JSON report somewhere deterministic outside the subject repo.","triggerScenarios":"Omitting --output entirely; passing --output=  (empty value); passing --output followed by only whitespace.","commonSituations":"Forgetting the required output flag; assuming a default output location exists; a template script that left the output blank.","solutions":["Add --output <path> (or -o <path>) pointing to the JSON report location.","Use the '=' form: --output=reports/out.json.","Ensure the value is non-empty and not just whitespace.","Run with --help to confirm the required flag."],"exampleFix":"# before\nnode benchmark-large-repo.mjs myrepo\n# after\nnode benchmark-large-repo.mjs myrepo --output reports/out.json","handlingStrategy":"validation","validationCode":"const hasOutput = argv.some(a => a === '--output' || a === '-o' || a.startsWith('--output='));\nif (!hasOutput) { /* reject early */ }","typeGuard":null,"tryCatchPattern":"try { const opts = parseArgs(argv); } catch (e) { if ((e as Error).name === 'CliUsageError') { console.error(e.message); process.exit(2); } throw e; }","preventionTips":["Always pass --output with a non-empty value.","In wrappers, assert the output path is provided and non-empty."],"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"}