{"record":{"id":"60be04cdbd6a1a97","repo":"affaan-m/ECC","slug":"unknown-argument-arg-60be04","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/skills-health.js","lineNumber":104,"sourceCode":"\n    if (arg === '--warn-threshold') {\n      options.warnThreshold = Number(requireValue(argv, index, '--warn-threshold'));\n      index += 1;\n      continue;\n    }\n\n    if (arg === '--dashboard') {\n      options.dashboard = true;\n      continue;\n    }\n\n    if (arg === '--panel') {\n      options.panel = requireValue(argv, index, '--panel');\n      index += 1;\n      continue;\n    }\n\n    throw new Error(`Unknown argument: ${arg}`);\n  }\n\n  return options;\n}\n\nfunction main() {\n  try {\n    const options = parseArgs(process.argv.slice(2));\n\n    if (options.help) {\n      showHelp();\n      process.exit(0);\n    }\n\n    if (options.dashboard || options.panel) {\n      const result = renderDashboard(options);\n      process.stdout.write(options.json ? `${JSON.stringify(result.data, null, 2)}\\n` : result.text);\n    } else {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/skills-health.js#L86-L122","documentation":"Thrown at the end of skills-health.js parseArgs when a token is not one of the accepted flags (--json, --help, --runs-file <path>, --now <ts>, --dashboard, --panel <name>, --warn-threshold <n>, and their value forms). The parser has no fallback and rejects unrecognized tokens.","triggerScenarios":"A typo (e.g. `--dashboardd`), a flag from another ECC script, or an unexpected positional argument.","commonSituations":"Mixing flags across ECC scripts; copy-pasting a stale command; using a long-form alias that is not supported.","solutions":["Run `node scripts/skills-health.js --help` to list accepted flags.","Correct typos and remove unsupported flags.","Confirm --panel names are from the documented set (success-rate, failures, amendments, versions)."],"exampleFix":"# before\nnode scripts/skills-health.js --pannel failures\n# after\nnode scripts/skills-health.js --panel failures","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set(['--json', '--help', '--runs-file', '--now', '--dashboard', '--panel', '--warn-threshold']);\nconst bad = process.argv.slice(2).filter(a => a.startsWith('--') && !ALLOWED.has(a.split('=')[0]));\nif (bad.length) { console.error('Unknown skills-health flag(s):', bad.join(' ')); process.exit(2); }","typeGuard":null,"tryCatchPattern":"try { parseArgs(process.argv.slice(2)); } catch (err) { console.error(err.message); process.exit(2); }","preventionTips":["Generate --help from the parser's allowlist so docs cannot drift.","Lint wrapper invocations in CI against the documented flag set."],"tags":["cli","argument-parsing","skills-health"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}