{"record":{"id":"ffb928a984d4a9ec","repo":"affaan-m/ECC","slug":"unknown-argument-arg-ffb928","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/install-plan.js","lineNumber":115,"sourceCode":"      }\n      index += 1;\n    } else if (arg === '--skill' || arg === '--skills') {\n      parsed.includeComponentIds.push(...normalizeSkillComponentIds(args[index + 1] || ''));\n      index += 1;\n    } else if (arg === '--without') {\n      const componentId = args[index + 1] || '';\n      if (componentId.trim()) {\n        parsed.excludeComponentIds.push(componentId.trim());\n      }\n      index += 1;\n    } else if (arg === '--config') {\n      parsed.configPath = args[index + 1] || null;\n      index += 1;\n    } else if (arg === '--target') {\n      parsed.target = args[index + 1] || null;\n      index += 1;\n    } else {\n      throw new Error(`Unknown argument: ${arg}`);\n    }\n  }\n\n  return parsed;\n}\n\nfunction printProfiles(profiles) {\n  console.log('Install profiles:\\n');\n  for (const profile of profiles) {\n    console.log(`- ${profile.id} (${profile.moduleCount} modules)`);\n    console.log(`  ${profile.description}`);\n  }\n}\n\nfunction printModules(modules) {\n  console.log('Install modules:\\n');\n  for (const module of modules) {\n    console.log(`- ${module.id} [${module.kind}]`);","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/install-plan.js#L97-L133","documentation":"install-plan.js recognizes a fixed flag set: --help/-h, --json, --list-profiles, --list-modules, --list-components, --family, --profile, --modules, --with, --skill/--skills, --without, --config, and --target. Any other token falls through to the final else branch and is rejected as an unknown argument.","triggerScenarios":"Passing --harness (an install-guided flag), --root (a harness-audit flag), --verbose, or a typo like --profil.","commonSituations":"Cross-contaminating flags from install-guided.js or harness-audit.js, using an outdated flag, or shell autocomplete inserting the wrong option.","solutions":["Run node scripts/install-plan.js --help to list accepted flags","Remove the unsupported flag","If you meant --profile (install-plan) vs --harness (install-guided), confirm you are invoking the right script"],"exampleFix":"// before\nnode scripts/install-plan.js --harness claude\n// after\nnode scripts/install-plan.js --profile core","handlingStrategy":"validation","validationCode":"const KNOWN = new Set(['--help','-h','--json','--list-profiles','--list-modules','--list-components','--family','--profile','--modules','--with','--skill','--skills','--without','--config','--target']);\nfor (const a of argv) {\n  if (a.startsWith('-') && !KNOWN.has(a)) throw new Error(`Unknown install-plan argument: ${a}`);\n}","typeGuard":"function isKnownInstallPlanArg(arg) {\n  return ['--help','-h','--json','--list-profiles','--list-modules','--list-components','--family','--profile','--modules','--with','--skill','--skills','--without','--config','--target'].includes(arg);\n}","tryCatchPattern":"try { parseInstallPlanArgs(argv); }\ncatch (err) {\n  if (/^Unknown argument:/.test(err.message)) {\n    console.error(`${err.message}\\nRun: node scripts/install-plan.js --help`);\n    process.exit(2);\n  }\n  throw err;\n}","preventionTips":["Note that install-plan and install-guided accept different flags","Keep a help-output snapshot and assert it in CI","Resolve typos by diffing against --help before scripting"],"tags":["cli","argument-parsing","install-plan"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}