{"record":{"id":"9cf83e096e7bac07","repo":"affaan-m/ECC","slug":"unknown-option-argument-put-the-executable-a","errorCode":null,"errorMessage":"Unknown option \"${argument}\"; put the executable after --.","messagePattern":"Unknown option \"(.+?)\"; put the executable after --\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/terminal-opener/scripts/open-terminal.js","lineNumber":132,"sourceCode":"      const value = readValue(argv, index, argument);\n      options[argument.slice(2)] = value;\n      index += 1;\n    } else if (argument === '--recover' || argument === '--standalone') {\n      options.mode = 'recover';\n    } else if (argument === '--detect') {\n      options.detect = true;\n    } else if (argument === '--launch') {\n      launchRequested = true;\n      options.dryRun = false;\n    } else if (argument === '--dry-run') {\n      dryRunRequested = true;\n      options.dryRun = true;\n    } else if (argument === '--json') {\n      options.json = true;\n    } else if (argument === '--help' || argument === '-h') {\n      options.help = true;\n    } else {\n      throw new Error(`Unknown option \"${argument}\"; put the executable after --.`);\n    }\n  }\n\n  if (launchRequested && dryRunRequested) {\n    throw new Error('--launch and --dry-run are mutually exclusive.');\n  }\n\n  validateTerminalName(options.terminal);\n  validateCwd(options.cwd);\n  if (!options.help && !options.detect && !options.executable) {\n    throw new Error('An executable is required after --.');\n  }\n  if (options.executable) validateExecutable(options.executable);\n  validateArgv(options.argv);\n  return options;\n}\n\nfunction unsupportedPlan(options) {","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/terminal-opener/scripts/open-terminal.js#L114-L150","documentation":"parseArgs only recognizes a fixed set of flags (--launch, --dry-run, --json, --help/-h, and the value-taking options) and throws this error for any unrecognized token in the option region. The message reminds users that the executable and its arguments belong after a `--` separator, where everything is treated as the launch command instead of being parsed as options.","triggerScenarios":"Typos like `--lanuch` or `--verbos`; passing the command before `--` (e.g. `open-terminal.js wezterm start`); inventing flags that don't exist in the script.","commonSituations":"Users copying commands from other tools with different flag sets; forgetting the `--` separator so positional command words are parsed as options; renamed/removed flags from an older script version.","solutions":["Add the missing `--` before the executable: `node open-terminal.js --terminal wezterm -- mycmd args`.","Fix the flag typo (check `--help` for the supported option list).","Remove unsupported flags; if a flag is genuinely needed, add it to the parseArgs dispatch in open-terminal.js."],"exampleFix":"// before\nnode open-terminal.js --terminal wezterm wezterm start\n// after\nnode open-terminal.js --terminal wezterm -- wezterm start","handlingStrategy":"validation","validationCode":"const KNOWN = new Set(['--terminal','--cwd','--executable','--launch','--dry-run','--json','--help','-h']);\nconst dd = process.argv.indexOf('--');\nconst optionRegion = dd === -1 ? process.argv.slice(2) : process.argv.slice(2, dd);\noptionRegion.forEach(t => { if (t.startsWith('-') && !KNOWN.has(t)) throw new Error(`unknown option ${t}`); });","typeGuard":"null","tryCatchPattern":"try {\n  parseArgs(process.argv);\n} catch (e) {\n  if (/Unknown option/.test(e.message)) {\n    console.error(e.message, '— run with --help to list supported flags');\n  } else throw e;\n}","preventionTips":["Always separate the launch command with `--`.","Verify flag names against --help output before scripting.","Handle renamed/removed flags when upgrading the tool.","Use shell completion or wrappers that expose the supported flag set."],"tags":["cli","parsing","arguments"],"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"}