{"record":{"id":"9ddf3e70fb2b7002","repo":"affaan-m/ECC","slug":"unknown-argument-arg-9ddf3e","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/feedback.js","lineNumber":27,"sourceCode":"  process.stdout.write(`\nUsage: ecc feedback [--json] [--help|-h]\n\nPrint ECC's low-friction public feedback routes. This command never uploads\ndiagnostics or reads project files.\n`);\n}\n\nfunction parseArgs(argv) {\n  return argv.slice(2).reduce((parsed, arg) => {\n    if (arg === '--json') {\n      return { ...parsed, json: true };\n    }\n\n    if (arg === '--help' || arg === '-h') {\n      return { ...parsed, help: true };\n    }\n\n    throw new Error(`Unknown argument: ${arg}`);\n  }, { json: false, help: false });\n}\n\nfunction printHuman() {\n  process.stdout.write([\n    'ECC feedback',\n    '',\n    `Install or runtime problem:\\n${FEEDBACK_ROUTES.problem}`,\n    '',\n    `Quick feedback (public GitHub issue):\\n${FEEDBACK_ROUTES.feedback}`,\n    '',\n    `Feature idea:\\n${FEEDBACK_ROUTES.feature}`,\n    '',\n    'ECC does not upload diagnostics or read project files. Redact sensitive information before posting publicly.',\n    '',\n  ].join('\\n'));\n}\n","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/feedback.js#L9-L45","documentation":"Sentinel guard at the end of feedback.js parseArgs: only --json and --help/-h are recognized, so any other token passed to 'ecc feedback' throws here; it enforces that this diagnostics-free command accepts no extra flags.","triggerScenarios":"Running `node scripts/feedback.js --verbose`, `--file x`, or any unrecognized option; typos like `--jsn` or `-j` also trigger it since only exact matches are accepted.","commonSituations":"Typos in flags, assuming feedback.js supports flags from other ECC scripts (like github-coordination.js's larger flag set), or passing global-style options it does not implement.","solutions":["Call as `ecc feedback` with at most --json and/or --help.","Remove stray positional arguments from the invocation.","Fix the typo in the calling command."],"exampleFix":"// before\n$ node scripts/feedback.js --verbose\nError: Unknown argument: --verbose\n// after\n$ node scripts/feedback.js --json","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set(['--json', '--help', '-h']);\nconst bad = process.argv.slice(2).filter(a => !ALLOWED.has(a));\nif (bad.length) console.error(`Unsupported flags: ${bad.join(' ')}`);","typeGuard":"const isKnownFeedbackFlag = (arg) => ['--json','--help','-h'].includes(arg);","tryCatchPattern":"try {\n  runFeedback(process.argv.slice(2));\n} catch (err) {\n  if (/^Unknown argument:/.test(err.message)) {\n    console.error(`${err.message}\\nUsage: feedback [--json] [--help]`);\n    process.exit(1);\n  }\n  throw err;\n}","preventionTips":["Run `node scripts/feedback.js --help` to see the only two supported flags.","Don't assume flags from other ECC scripts work here.","Double-check flag spelling (--json, not --jsn)."],"tags":["cli","invalid-cli-argument","argument-parsing"],"backgroundTag":"invalid-cli-argument","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}