{"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":"exception","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/01e15490f04e29cfefe3896951f43db46994d8ee/skills/terminal-opener/scripts/open-terminal.js#L125-L161","documentation":"Unless --help or --detect is requested, parseArgs requires an executable after --. If no executable is supplied (no -- token, or a -- with nothing after it), this throws at line 142. --help and --detect are the only modes that do not need an executable.","triggerScenarios":"Running with only flags and no executable, or a trailing -- with nothing after it, while not using --help or --detect.","commonSituations":"Forgetting the executable; intending to run --detect but omitting it; a wrapper that strips the executable token.","solutions":["Add '-- <executable> [args...]' to the command line.","If you only wanted to probe or see help, pass --detect or --help instead."],"exampleFix":"# before\nnode open-terminal.js --terminal wezterm\n\n# after\nnode open-terminal.js --terminal wezterm -- echo hi","handlingStrategy":"validation","validationCode":"const hasExecutable = argv.includes('--') && argv[argv.indexOf('--') + 1] !== undefined;\nconst isProbeOrHelp = argv.includes('--detect') || argv.includes('--help') || argv.includes('-h');\nif (!hasExecutable && !isProbeOrHelp) {\n  throw new Error('An executable is required after -- (or use --detect/--help)');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always terminate options with -- followed by the executable and its args.","Use --detect or --help when you do not intend to launch a command."],"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"}