affaan-m/ECC · error · Error
Unknown argument: ${argument}
Error message
Unknown argument: ${argument} What it means
Thrown by setup.js parseArgs when a token is not one of the recognized flags (--mode, --scope, --hooks and their values, --yes/-y, --dry-run, --move-scope, --json, --help/-h). The parser has no catch-all branch and treats any other token as a fatal usage error.
Source
Thrown at scripts/setup.js:99
if (valueFlags.has(argument)) {
const value = argv[index + 1];
if (!value || value.startsWith('--')) {
throw new Error(`Missing value for ${argument}`);
}
options[valueFlags.get(argument)] = value;
index += 1;
} else if (argument === '--yes' || argument === '-y') {
options.yes = true;
} else if (argument === '--dry-run') {
options.dryRun = true;
} else if (argument === '--move-scope') {
options.moveScope = true;
} else if (argument === '--json') {
options.json = true;
} else if (argument === '--help' || argument === '-h') {
options.help = true;
} else {
throw new Error(`Unknown argument: ${argument}`);
}
}
if (options.mode !== undefined && options.mode !== MODE) {
throw new Error(`Invalid setup mode: ${options.mode}. This command currently supports ${MODE}.`);
}
if (options.scope !== undefined && !VALID_SCOPES.has(options.scope)) {
throw new Error(`Invalid --scope value: ${options.scope}`);
}
if (options.hooks !== undefined && !VALID_HOOK_MODES.has(options.hooks)) {
throw new Error(`Invalid --hooks value: ${options.hooks}`);
}
if (options.moveScope && options.scope === undefined) {
throw new Error('--move-scope requires an explicit --scope destination.');
}
return options;
}
View on GitHub (pinned to 01e15490f0)
Solutions
- Run `node scripts/setup.js --help` to list accepted flags.
- Correct typos (`--dry-run`, `--move-scope`, `--yes`).
- Remove flags that belong to other ECC scripts.
- Use `=` form for value flags to avoid stray tokens.
Example fix
# before node scripts/setup.js --dryrun --yes # after node scripts/setup.js --dry-run --yes
Defensive patterns
Strategy: validation
Validate before calling
const ALLOWED = new Set(['--mode', '--scope', '--hooks', '--yes', '-y', '--dry-run', '--move-scope', '--json', '--help', '-h']);
const bad = process.argv.slice(2).filter(a => a.startsWith('--') && !ALLOWED.has(a.split('=')[0]));
if (bad.length) { console.error('Unknown setup flag(s):', bad.join(' ')); process.exit(2); } Try / catch
try { parseArgs(process.argv); } catch (err) { console.error(err.message); process.exit(2); } Prevention
- Maintain one allowlist shared by the parser and the docs generator.
- Lint CI invocations against the allowlist so typos fail fast.
When it happens
Trigger: A typo (e.g. `--dryrun`), a flag from repair.js/release-video-suite.js, or an unexpected positional argument. Also triggered by a leading `--` token not in the allowlist.
Common situations: Mixing flags across ECC scripts; using a long-form alias the parser does not support; copy-pasting a command from outdated docs.
Related errors
- Missing value for ${argument}
- Invalid setup mode: ${options.mode}. This command currently
- Invalid --scope value: ${options.scope}
- Invalid --hooks value: ${options.hooks}
- --move-scope requires an explicit --scope destination.
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/04b4921f49e9369c.
Report an issue: GitHub.