[PR #1580] [MERGED] fix double help printing #9981

Closed
opened 2026-02-16 18:14:30 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1580
Author: @rekram1-node
Created: 8/3/2025
Status: Merged
Merged: 8/4/2025
Merged by: @adamdotdevin

Base: devHead: fix-double-help


📝 Commits (1)

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 packages/opencode/src/index.ts (+1 -0)

📄 Description

fixes: #149

Now help messages won't show twice

Uses process.exit(1) as outlined in yargs docs:

import yargs from 'yargs'
const argv = yargs(process.argv.slice(2))
  .fail(function (msg, err, yargs) {
    if (err) throw err // preserve stack
    console.error('You broke it!')
    console.error(msg)
    console.error('You should be doing', yargs.help())
    process.exit(1)
  })
  .parse()

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1580 **Author:** [@rekram1-node](https://github.com/rekram1-node) **Created:** 8/3/2025 **Status:** ✅ Merged **Merged:** 8/4/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `fix-double-help` --- ### 📝 Commits (1) - [`10e437d`](https://github.com/anomalyco/opencode/commit/10e437da00657e355a0f30d2eb7d2b6d743b6539) fix double help printing ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/index.ts` (+1 -0) </details> ### 📄 Description fixes: #149 Now help messages won't show twice Uses process.exit(1) as outlined in yargs docs: ``` import yargs from 'yargs' const argv = yargs(process.argv.slice(2)) .fail(function (msg, err, yargs) { if (err) throw err // preserve stack console.error('You broke it!') console.error(msg) console.error('You should be doing', yargs.help()) process.exit(1) }) .parse() ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:30 -05:00
yindo closed this issue 2026-02-16 18:14:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9981