Uh oh!
There was an error while loading. Please reload this page.
fix(opencode): add trailing newline to CLI help output - #29898
Conversation
The following comment was made by an LLM, it may be inaccurate: Found potential duplicates! There are several related PRs addressing the same help output newline issue:
These PRs all address the same issue of adding a trailing newline to CLI help output. The current PR (#29898) appears to be another attempt to fix the same problem, likely because the previous PRs may have been closed or incomplete. You may want to check the status of these older PRs and consolidate efforts if they're still open. |
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes#28606#26114#24804#22115
Type of change
What does this PR do?
The CLI help output (
opencode --helpandopencode <command> --help) is written to stderr without a trailing newline. This meant the shell prompt appears directly appended to the last line of the help text, and any tooling consuming the output have no terminating newline.In
show()inpackages/opencode/src/index.ts, both write paths nowtrimEnd()the help text and append a singleEOL. This guarantees exactly one trailing newline regardless of whether yargs already produced trailing whitespace, in both the logo branch and the default branch.I updated the help-text snapshots to reflect the new trailing newline.
How did you verify your code works?
Ran the CLI help commands locally and confirmed the output ends with a single newline. Re-ran the help snapshot test suite, which now passes with the regenerated snapshots.
Screenshots / recordings
N/A — CLI text output change, covered by snapshot tests.
Checklist