{"record":{"id":"27043d447ee7997c","repo":"stablyai/orca","slug":"unknown-argument-arg-27043d","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/macos-computer-helper-owner-loss-benchmark.mjs","lineNumber":402,"sourceCode":"    invalidPeer?.destroy()\n    sidecar?.child.kill('SIGKILL')\n    await stopProcess(helper)\n  }\n}\n\nfunction parseArgs(argv) {\n  const options = { expect: '', trials: DEFAULT_TRIALS, output: '' }\n  for (let index = 0; index < argv.length; index += 1) {\n    const arg = argv[index]\n    const value = argv[index + 1]\n    if (arg === '--expect' || arg === '--trials' || arg === '--output') {\n      if (!value) {\n        throw new Error(`Missing value for ${arg}`)\n      }\n      options[arg.slice(2)] = arg === '--trials' ? Number(value) : value\n      index += 1\n    } else {\n      throw new Error(`Unknown argument: ${arg}`)\n    }\n  }\n  if (!['retained', 'reaped'].includes(options.expect)) {\n    throw new Error('--expect must be retained or reaped')\n  }\n  if (!Number.isInteger(options.trials) || options.trials < 1) {\n    throw new Error('--trials must be a positive integer')\n  }\n  return options\n}\n\nfunction electronPath() {\n  const electronModulePath = fileURLToPath(import.meta.resolve('electron'))\n  return execFileSync(\n    process.execPath,\n    ['-e', `process.stdout.write(require(${JSON.stringify(electronModulePath)}))`],\n    { encoding: 'utf8' }\n  )","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/macos-computer-helper-owner-loss-benchmark.mjs#L384-L420","documentation":"CLI argument parser encounters a token that is not --expect, --trials, or --output. These are the only three recognized flags; any other token (including short flags, positional args, or typos) hits the else branch at line 401.","triggerScenarios":"Any unrecognized argument: --verbose, -v, --help, a bare positional path, or a typo like --exepect. The token does not match any of the three known flags.","commonSituations":"Typo in a flag name; passing a flag from an older/newer version of the script; a wrapper script adds extra args; user expects --help or --version to work.","solutions":["Remove the unrecognized argument","Verify the supported flags: --expect (retained|reaped), --trials (positive int), --output (path)","Check for typos in flag names"],"exampleFix":"// before\nnode benchmark.mjs --verbose --expect reaped\n\n// after\nnode benchmark.mjs --expect reaped","handlingStrategy":"validation","validationCode":"// Validate all args are known before parsing\nconst KNOWN_FLAGS = new Set(['--expect', '--trials', '--output'])\nfor (const arg of argv) {\n  if (arg.startsWith('--') && !KNOWN_FLAGS.has(arg)) {\n    throw new Error(`Unsupported flag: ${arg}. Supported: --expect, --trials, --output`)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Review the supported flags before invoking: --expect, --trials, --output","Check for typos in flag names","Remove flags from older script versions that are no longer supported"],"tags":["cli","argument-parsing"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}