{"record":{"id":"442dfc8b5e49ca4a","repo":"affaan-m/ECC","slug":"unknown-argument-run-guided-install-with-help-t","errorCode":null,"errorMessage":"Unknown argument. Run guided install with --help to see valid options.","messagePattern":"Unknown argument\\. Run guided install with --help to see valid options\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/install-guided.js","lineNumber":103,"sourceCode":"        throw new Error(`Value for ${argument} is too long.`);\n      }\n      const key = valueFlags.get(argument);\n      options = key === 'harnesses'\n        ? { ...options, harnesses: [...options.harnesses, value] }\n        : { ...options, [key]: value };\n      index += 1;\n    } else if (argument === '--all-harnesses') {\n      options = { ...options, allHarnesses: true };\n    } else if (argument === '--yes' || argument === '-y') {\n      options = { ...options, yes: true };\n    } else if (argument === '--dry-run') {\n      options = { ...options, dryRun: true };\n    } else if (argument === '--json') {\n      options = { ...options, json: true };\n    } else if (argument === '--help' || argument === '-h') {\n      options = { ...options, help: true };\n    } else {\n      throw new Error('Unknown argument. Run guided install with --help to see valid options.');\n    }\n  }\n  if (options.allHarnesses && options.harnesses.length > 0) {\n    throw new Error('--all-harnesses and --harness are mutually exclusive.');\n  }\n  return options;\n}\n\nfunction choicesText(values) {\n  return values.join('|');\n}\n\nasync function askChoice(terminal, output, prompt, values, defaultValue) {\n  output.write(`\\n${prompt}\\n`);\n  values.forEach((value, index) => output.write(`  ${index + 1}. ${value}\\n`));\n  while (true) {\n    const question = defaultValue\n      ? `Choose [Recommended: ${defaultValue}] (one option only): `","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/install-guided.js#L85-L121","documentation":"parseArgs in scripts/install-guided.js throws this when an argument is not one of the recognized flags (--harness, --all-harnesses, --dry-run, --json, --help/-h, and the known value flags). The message directs users to --help, making unknown flags fail fast.","triggerScenarios":"Running `node scripts/install-guided.js --harlesson`, a positional word like `install`, or a flag from a different tool (`-y`, `--force`) that this CLI does not define.","commonSituations":"Typoed flags, muscle-memory flags from npm/other CLIs, scripting with flags from an older or newer version of the installer.","solutions":["Run `node scripts/install-guided.js --help` to list valid options","Correct the flag spelling (e.g. --dry-run, --all-harnesses, --harness)","Remove flags not supported by this installer (e.g. -y, --force)","If automating, pin the installer version so flags match the script"],"exampleFix":"// before\nnode scripts/install-guided.js --force\n// after\nnode scripts/install-guided.js --all-harnesses --dry-run","handlingStrategy":"validation","validationCode":"const VALID = new Set(['--harness', '--all-harnesses', '--dry-run', '--json', '--help', '-h']);\nconst unknown = rawArgv.filter(a => a.startsWith('-') && !VALID.has(a));\nif (unknown.length) throw new Error(`Unknown argument: ${unknown.join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  parseArgs(rawArgv);\n} catch (err) {\n  if (err.message.startsWith('Unknown argument.')) {\n    console.error(`${err.message}\\nRun: node scripts/install-guided.js --help`);\n    process.exit(2);\n  }\n  throw err;\n}","preventionTips":["Consult --help before adding new flags to automation scripts","Do not reuse flags from other CLIs (-y, --force) here","Pin the installer version in CI so flags stay stable"],"tags":["cli","argument-parsing","unknown-flag"],"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"}