{"record":{"id":"6b4946d14c78cee7","repo":"affaan-m/ECC","slug":"unknown-argument-arg-6b4946","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/operator-readiness-dashboard.js","lineNumber":214,"sourceCode":"    }\n\n    if (arg === '--generated-at') {\n      parsed.generatedAt = readValue(args, index, arg);\n      index += 1;\n      continue;\n    }\n\n    if (arg.startsWith('--generated-at=')) {\n      parsed.generatedAt = arg.slice('--generated-at='.length);\n      continue;\n    }\n\n    if (arg === '--exit-code') {\n      parsed.exitCode = true;\n      continue;\n    }\n\n    throw new Error(`Unknown argument: ${arg}`);\n  }\n\n  if (!['text', 'json', 'markdown'].includes(parsed.format)) {\n    throw new Error(`Invalid format: ${parsed.format}. Use text, json, or markdown.`);\n  }\n\n  if (parsed.writePath && parsed.format === 'text') {\n    throw new Error('--write requires --json, --markdown, or --format json|markdown');\n  }\n\n  parsed.allowUntracked = parsed.allowUntracked.map(normalizeRelativePrefix).filter(Boolean);\n\n  return parsed;\n}\n\nfunction readText(rootDir, relativePath) {\n  try {\n    return fs.readFileSync(path.join(rootDir, relativePath), 'utf8');","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/operator-readiness-dashboard.js#L196-L232","documentation":"Thrown by parseArgs in scripts/operator-readiness-dashboard.js when a `--` token matches none of the recognized flags. This dashboard has a much larger flag surface than observability-readiness (--json, --markdown, --write, --root, --repo, --skip-github, --allow-untracked, --max-open-prs, --max-open-issues, --max-dirty-files, --use-env-github-token, --generated-at, --exit-code, --help), but anything outside that set is still rejected.","triggerScenarios":"Typos like `--wrtie`, `--repos` (singular is `--repo`, repeatable); flags from the sibling observability-readiness.js that are not implemented here (e.g. `--format text` — use `--json`/`--markdown` instead, though `--format=` is also accepted); unsupported shorthand like `-q`.","commonSituations":"Mixing up the two readiness scripts' flag sets; an agent guessing flag names; documentation drift after a flag rename.","solutions":["Run `node scripts/operator-readiness-dashboard.js --help` to list accepted flags.","For output format, use `--json`, `--markdown`, or `--format=json|markdown` rather than `--format text`.","For multiple repos, repeat `--repo` (or use `--repo=`) rather than a plural `--repos`."],"exampleFix":"// before\nnode scripts/operator-readiness-dashboard.js --repos owner/repo\n// after\nnode scripts/operator-readiness-dashboard.js --repo owner/repo","handlingStrategy":"validation","validationCode":"const DASH_FLAGS = new Set(['--json', '--markdown', '--write', '--root', '--repo', '--skip-github', '--allow-untracked', '--max-open-prs', '--max-open-issues', '--max-dirty-files', '--use-env-github-token', '--generated-at', '--exit-code', '--help', '-h']);\nfunction assertKnownDashFlags(argv) {\n  for (const a of argv) {\n    if (a.startsWith('--') && !a.includes('=') && !DASH_FLAGS.has(a)) {\n      throw new Error(`Unsupported flag for operator-readiness-dashboard: ${a}`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use --repo (repeatable) for multiple repos, never --repos.","Prefer --json/--markdown over --format text for machine consumption.","Refresh the allowlist from --help after ECC upgrades."],"tags":["cli","operator-dashboard","argument-validation"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}