[PR #5185] fix(cli): prevent help text wrapping #11280

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

Original Pull Request: https://github.com/anomalyco/opencode/pull/5185

State: closed
Merged: Yes


Overview

The current opencode -h wraps unnecessarily in a few places ( opencode upgrade [target], opencode pr , --log-level) due to yargs default width:

Screenshot 2025-12-06 at 5 31 00 PM

This makes it harder to skim the text.

Proposed fix

Set .wrap(null) on yargs to prevent wrapping.

Screenshot 2025-12-06 at 5 32 38 PM

The potential drawback here is that the type/choices don't align neatly on the right, but personally I find it easier to read without that alignment.

An alternate solution is to just hardcode the number of cols to wrap on, eg here is .wrap(120)
Screenshot 2025-12-06 at 5 34 38 PM

This preserves the right alignment of types/choices but is more brittle.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5185 **State:** closed **Merged:** Yes --- ## Overview The current `opencode -h` wraps unnecessarily in a few places ( opencode upgrade [target], opencode pr <number>, --log-level) due to yargs default width: <img width="684" height="634" alt="Screenshot 2025-12-06 at 5 31 00 PM" src="https://github.com/user-attachments/assets/15255f01-93a5-4d8e-8efe-500cbcb548f4" /> This makes it harder to skim the text. ## Proposed fix Set `.wrap(null)` on yargs to prevent wrapping. <img width="758" height="590" alt="Screenshot 2025-12-06 at 5 32 38 PM" src="https://github.com/user-attachments/assets/9d65b184-52d0-4b05-80e7-ee5dbbf46303" /> The potential drawback here is that the type/choices don't align neatly on the right, but personally I find it easier to read without that alignment. An alternate solution is to just hardcode the number of cols to wrap on, eg here is `.wrap(120)` <img width="973" height="585" alt="Screenshot 2025-12-06 at 5 34 38 PM" src="https://github.com/user-attachments/assets/190d4b1e-e29a-452b-8115-1f1bcc6dbfe0" /> This preserves the right alignment of types/choices but is more brittle.
yindo added the pull-request label 2026-02-16 18:16:05 -05:00
yindo closed this issue 2026-02-16 18:16:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11280