{"record":{"id":"9ddf3e70fb2b7002","repo":"affaan-m/ECC","slug":"unknown-argument-arg-9ddf3e","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"exception","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/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/feedback.js#L9-L45","documentation":"Thrown by parseArgs() in scripts/feedback.js when an unrecognized CLI argument is passed. The feedback script only accepts three arguments: --json, --help, and -h. Any other argument is rejected. The script is intentionally minimal — it only prints feedback route URLs.","triggerScenarios":"Running `node scripts/feedback.js --format text`, `node scripts/feedback.js extra`, or passing any flag/positional other than --json, --help, or -h.","commonSituations":"A user assumes the feedback script accepts more options (like --format or a message argument) or passes a global flag meant for the main ecc.js CLI to this sub-script instead.","solutions":["Run `node scripts/feedback.js --help` to see the only accepted flags.","Remove any arguments other than --json, --help, or -h.","If you need to file actual feedback, use the URL the script prints rather than trying to pass it as an argument."],"exampleFix":"// before\nnode scripts/feedback.js --format json\n// after\nnode scripts/feedback.js --json","handlingStrategy":"validation","validationCode":"const VALID = new Set(['--json', '--help', '-h']);\nconst invalid = process.argv.slice(2).filter(a => !VALID.has(a));\nif (invalid.length > 0) {\n  console.error(`Unknown argument(s): ${invalid.join(', ')}. Accepted: --json, --help, -h`);\n  process.exit(1);\n}","typeGuard":"function isFeedbackArg(arg) {\n  return ['--json', '--help', '-h'].includes(arg);\n}","tryCatchPattern":null,"preventionTips":["Check --help before passing arguments to a minimal utility script.","Do not pass flags meant for the main CLI to sub-scripts.","Keep a reference of accepted flags near the invocation point in docs."],"tags":["cli","argument-parsing","user-input"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}