{"record":{"id":"5540097d3a8f63d2","repo":"affaan-m/ECC","slug":"launch-and-dry-run-are-mutually-exclusive","errorCode":null,"errorMessage":"--launch and --dry-run are mutually exclusive.","messagePattern":"--launch and --dry-run are mutually exclusive\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/terminal-opener/scripts/open-terminal.js","lineNumber":137,"sourceCode":"    } 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) {\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,","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/skills/terminal-opener/scripts/open-terminal.js#L119-L155","documentation":"parseArgs tracks both launchRequested and dryRunRequested. If both are set it throws, because --dry-run means 'print the launch plan only' and --launch means 'actually open the terminal', which are contradictory. Note the default (neither flag) is already dry-run.","triggerScenarios":"Passing both --launch and --dry-run on the same command line. parseArgs checks the combination at line 136 after the flag loop.","commonSituations":"Copy-pasting flags from two sources; a wrapper script that unions both flags defensively; misunderstanding that dry-run is the default.","solutions":["Choose one: drop --dry-run if you want to actually launch, or drop --launch if you only want the plan.","Since dry-run is the default, you can omit --dry-run entirely when you want a plan."],"exampleFix":"# before\nnode open-terminal.js --launch --dry-run -- echo hi\n\n# after\nnode open-terminal.js --launch -- echo hi","handlingStrategy":"validation","validationCode":"if (argv.includes('--launch') && argv.includes('--dry-run')) {\n  throw new Error('--launch and --dry-run are mutually exclusive');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember dry-run is the default; you rarely need --dry-run explicitly.","In wrappers, branch on intent (plan vs launch) rather than unioning both flags."],"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"}