{"record":{"id":"efe92049efbd4c97","repo":"stablyai/orca","slug":"arg-requires-a-path","errorCode":null,"errorMessage":"${arg} requires a path","messagePattern":"(.+?) requires a path","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/generate-terminal-perf-html-report.mjs","lineNumber":63,"sourceCode":"  revisitMs: '#0d9488'\n}\n\nconst LABELED_INPUT_RE = /^([\\w .#@()+-]+)=(.+)$/\n\nexport function parseHtmlReportArgs(argv, env = process.env) {\n  const args = [...argv]\n  if (args[0] === '--') {\n    args.shift()\n  }\n\n  const inputs = []\n  let outputPath = env.ORCA_E2E_TERMINAL_PERF_HTML_REPORT_PATH || DEFAULT_OUTPUT_PATH\n  for (let index = 0; index < args.length; index += 1) {\n    const arg = args[index]\n    if (arg === '--output' || arg === '-o') {\n      const next = args[index + 1]\n      if (!next || next.startsWith('-')) {\n        throw new Error(`${arg} requires a path`)\n      }\n      outputPath = next\n      index += 1\n      continue\n    }\n    if (arg.startsWith('--output=')) {\n      outputPath = arg.slice('--output='.length)\n      continue\n    }\n    const labeled = arg.match(LABELED_INPUT_RE)\n    if (labeled) {\n      inputs.push({ label: labeled[1], path: labeled[2] })\n    } else {\n      inputs.push({ label: basename(arg).replace(/\\.json$/i, ''), path: arg })\n    }\n  }\n\n  if (inputs.length === 0) {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/generate-terminal-perf-html-report.mjs#L45-L81","documentation":"Thrown by parseHtmlReportArgs when --output (or -o) is followed by a token that is missing or starts with '-', meaning no output path was supplied. The output path defaults to test-results/terminal-perf-impact-report.html or the ORCA_E2E_TERMINAL_PERF_HTML_REPORT_PATH env var, so --output is only needed to override it (generate-terminal-perf-html-report.mjs:60-64).","triggerScenarios":"Passing '--output' as the last token; passing '--output -v' or '--output --foo'; a shell variable for the path expanding to empty.","commonSituations":"A CI step computing a report dir that is unset on some matrix legs; misordered flags where a path-like flag is actually another option; trailing --output after trimming a command.","solutions":["Provide a non-dash-prefixed file path token after --output/-o.","Or remove --output to use the default path or the ORCA_E2E_TERMINAL_PERF_HTML_REPORT_PATH env var.","Guard shell variables: --output \"${REPORT_PATH:?missing}\"."],"exampleFix":"// before\nparseHtmlReportArgs(['--output'])\n// after\nparseHtmlReportArgs(['report.html', '--output', 'out/perf.html'])","handlingStrategy":"validation","validationCode":"const i = argv.indexOf('--output')\nif (i !== -1 && (i + 1 >= argv.length || argv[i + 1].startsWith('-'))) {\n  throw new Error('--output requires a path')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit --output to use the default path when no override is needed.","Guard shell path variables with ${VAR:?missing}."],"tags":["cli","argument-validation","benchmark"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}