{"record":{"id":"e76d746009d383a7","repo":"affaan-m/ECC","slug":"an-executable-is-required-after","errorCode":null,"errorMessage":"An executable is required after --.","messagePattern":"An executable is required after --\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/terminal-opener/scripts/open-terminal.js","lineNumber":143,"sourceCode":"      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) {\n  return {\n    ok: false,\n    reason: 'unsupported-terminal',\n    action: `Terminal \"${options.terminal}\" is not supported. Install WezTerm, then rerun with --terminal wezterm.`,\n    terminal: options.terminal,\n    executable: options.executable,\n    argv: [...options.argv],\n    cwd: options.cwd,\n    dryRun: options.dryRun,\n    launchMode: options.mode === 'recover' ? 'recover' : 'mux',\n    command: null,","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/terminal-opener/scripts/open-terminal.js#L125-L161","documentation":"parseArgs requires an executable to run after the `--` separator. Unless the call is a pure informational mode (--help, --detect, or --executable listing), there is nothing to launch without a trailing executable, so the parser throws instead of building a useless plan.","triggerScenarios":"Running `node open-terminal.js --launch` or `node open-terminal.js` with no `-- <command>` suffix, and none of --help/--detect/--executable is present, so options.executable stays undefined.","commonSituations":"Forgetting the double-dash separator and putting the command as a bare argument before it; passing only flags copied from a help example; shell quoting swallowing the executable argument; scripting where the command variable is empty.","solutions":["Append ` -- <executable>` (plus any args) to the command line, e.g. `--launch -- vim`.","If you only wanted terminal detection, add --detect instead of an executable.","If you wanted the list of supported terminals, pass --executable (the listing mode) rather than an empty launch.","Check that the variable holding the command in your script is non-empty before invoking."],"exampleFix":"// before\nnode open-terminal.js --launch\n// after\nnode open-terminal.js --launch -- htop","handlingStrategy":"validation","validationCode":"const sep = argv.indexOf('--');\nconst executable = sep >= 0 ? argv.slice(sep + 1) : [];\nif (executable.length === 0 && !argv.includes('--help') && !argv.includes('--detect') && !argv.includes('--executable')) {\n  throw new Error('Provide an executable after --, e.g. open-terminal --launch -- vim');\n}","typeGuard":"function hasExecutableAfterSeparator(argv) {\n  const sep = argv.indexOf('--');\n  return sep !== -1 && argv.length > sep + 1;\n}","tryCatchPattern":"try {\n  const options = parseArgs(argv);\n} catch (err) {\n  if (err.message.includes('executable is required')) {\n    console.error('Missing command: add ` -- <executable>` after your flags.');\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Always place the executable and its args strictly after `--`.","Check the command variable is non-empty before building the CLI invocation in scripts.","Run --help once to confirm the expected argument layout."],"tags":["cli","missing-argument"],"backgroundTag":"missing-required-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"}