affaan-m/ECC · error · Error
Unknown argument: ${arg}
Error message
Unknown argument: ${arg} What it means
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.
Source
Thrown at scripts/feedback.js:27
process.stdout.write(`
Usage: ecc feedback [--json] [--help|-h]
Print ECC's low-friction public feedback routes. This command never uploads
diagnostics or reads project files.
`);
}
function parseArgs(argv) {
return argv.slice(2).reduce((parsed, arg) => {
if (arg === '--json') {
return { ...parsed, json: true };
}
if (arg === '--help' || arg === '-h') {
return { ...parsed, help: true };
}
throw new Error(`Unknown argument: ${arg}`);
}, { json: false, help: false });
}
function printHuman() {
process.stdout.write([
'ECC feedback',
'',
`Install or runtime problem:\n${FEEDBACK_ROUTES.problem}`,
'',
`Quick feedback (public GitHub issue):\n${FEEDBACK_ROUTES.feedback}`,
'',
`Feature idea:\n${FEEDBACK_ROUTES.feature}`,
'',
'ECC does not upload diagnostics or read project files. Redact sensitive information before posting publicly.',
'',
].join('\n'));
}
View on GitHub (pinned to 01e15490f0)
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.
Example fix
// before node scripts/feedback.js --format json // after node scripts/feedback.js --json
Defensive patterns
Strategy: validation
Validate before calling
const VALID = new Set(['--json', '--help', '-h']);
const invalid = process.argv.slice(2).filter(a => !VALID.has(a));
if (invalid.length > 0) {
console.error(`Unknown argument(s): ${invalid.join(', ')}. Accepted: --json, --help, -h`);
process.exit(1);
} Type guard
function isFeedbackArg(arg) {
return ['--json', '--help', '-h'].includes(arg);
} Prevention
- 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.
When it happens
Trigger: Running `node scripts/feedback.js --format text`, `node scripts/feedback.js extra`, or passing any flag/positional other than --json, --help, or -h.
Common situations: 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.
Related errors
- Unknown command: ${firstArg}
- Unknown command: ${resolution.command}
- Expected at most one agents directory argument
- ${flagName} requires a value
- Unknown argument: ${arg}
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/9ddf3e70fb2b7002.
Report an issue: GitHub.