{"record":{"id":"04b4921f49e9369c","repo":"affaan-m/ECC","slug":"unknown-argument-argument","errorCode":null,"errorMessage":"Unknown argument: ${argument}","messagePattern":"Unknown argument: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/setup.js","lineNumber":99,"sourceCode":"    if (valueFlags.has(argument)) {\n      const value = argv[index + 1];\n      if (!value || value.startsWith('--')) {\n        throw new Error(`Missing value for ${argument}`);\n      }\n      options[valueFlags.get(argument)] = value;\n      index += 1;\n    } else if (argument === '--yes' || argument === '-y') {\n      options.yes = true;\n    } else if (argument === '--dry-run') {\n      options.dryRun = true;\n    } else if (argument === '--move-scope') {\n      options.moveScope = true;\n    } else if (argument === '--json') {\n      options.json = true;\n    } else if (argument === '--help' || argument === '-h') {\n      options.help = true;\n    } else {\n      throw new Error(`Unknown argument: ${argument}`);\n    }\n  }\n\n  if (options.mode !== undefined && options.mode !== MODE) {\n    throw new Error(`Invalid setup mode: ${options.mode}. This command currently supports ${MODE}.`);\n  }\n  if (options.scope !== undefined && !VALID_SCOPES.has(options.scope)) {\n    throw new Error(`Invalid --scope value: ${options.scope}`);\n  }\n  if (options.hooks !== undefined && !VALID_HOOK_MODES.has(options.hooks)) {\n    throw new Error(`Invalid --hooks value: ${options.hooks}`);\n  }\n  if (options.moveScope && options.scope === undefined) {\n    throw new Error('--move-scope requires an explicit --scope destination.');\n  }\n  return options;\n}\n","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/setup.js#L81-L117","documentation":"Thrown by setup.js parseArgs when a token is not one of the recognized flags (--mode, --scope, --hooks and their values, --yes/-y, --dry-run, --move-scope, --json, --help/-h). The parser has no catch-all branch and treats any other token as a fatal usage error.","triggerScenarios":"A typo (e.g. `--dryrun`), a flag from repair.js/release-video-suite.js, or an unexpected positional argument. Also triggered by a leading `--` token not in the allowlist.","commonSituations":"Mixing flags across ECC scripts; using a long-form alias the parser does not support; copy-pasting a command from outdated docs.","solutions":["Run `node scripts/setup.js --help` to list accepted flags.","Correct typos (`--dry-run`, `--move-scope`, `--yes`).","Remove flags that belong to other ECC scripts.","Use `=` form for value flags to avoid stray tokens."],"exampleFix":"# before\nnode scripts/setup.js --dryrun --yes\n# after\nnode scripts/setup.js --dry-run --yes","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set(['--mode', '--scope', '--hooks', '--yes', '-y', '--dry-run', '--move-scope', '--json', '--help', '-h']);\nconst bad = process.argv.slice(2).filter(a => a.startsWith('--') && !ALLOWED.has(a.split('=')[0]));\nif (bad.length) { console.error('Unknown setup flag(s):', bad.join(' ')); process.exit(2); }","typeGuard":null,"tryCatchPattern":"try { parseArgs(process.argv); } catch (err) { console.error(err.message); process.exit(2); }","preventionTips":["Maintain one allowlist shared by the parser and the docs generator.","Lint CI invocations against the allowlist so typos fail fast."],"tags":["cli","argument-parsing","setup"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}