{"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":"exception","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/01e15490f04e29cfefe3896951f43db46994d8ee/skills/terminal-opener/scripts/open-terminal.js#L114-L150","documentation":"parseArgs has an allowlist of flags (--terminal, --cwd, --recover, --standalone, --detect, --launch, --dry-run, --json, --help/-h, and the -- separator). Any token before -- that is not recognized throws this error, naming the offending token. The executable and its arguments must come after --, so a bare token before -- is treated as an unknown option rather than the executable.","triggerScenarios":"Passing a flag like --foo, or placing the executable before -- (so it looks like an unknown option). parseArgs hits the final else branch at line 131.","commonSituations":"Forgetting the -- separator before the executable; typo in a flag name; using a flag from a different/newer version of the tool; copy-pasting a command from docs that omitted --.","solutions":["Put the executable and its args after a -- separator.","Check `node open-terminal.js --help` for the supported flag list and spellings.","Remove or correct the offending token."],"exampleFix":"# before\nnode open-terminal.js echo hi\n\n# after\nnode open-terminal.js -- echo hi","handlingStrategy":"validation","validationCode":"const KNOWN_OPTIONS = new Set(['--', '--terminal', '--cwd', '--recover', '--standalone', '--detect', '--launch', '--dry-run', '--json', '--help', '-h']);\nfor (const tok of argv) {\n  if (tok.startsWith('--') && !KNOWN_OPTIONS.has(tok) && tok !== '--') {\n    throw new Error(`Unknown option ${tok}; put the executable after --`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always separate the executable from options with --.","Print usage (`--help`) when surfacing this error to the user so they see the allowlist."],"tags":["validation","argument-parsing","terminal"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}