fix(opencode): show error message in CLI .fail() handler - #29393
Conversation
|
Hi, I opened #29393 for this fix with the correct PR template (including issue ref, description, testing steps, checklist). I noticed the same fix was later committed directly to dev in 90a8c07 without going through my PR. Could you help me understand why? Happy to improve next time. Thanks. |
|
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 #29390
Type of change
What does this PR do?
The CLI .fail() handler receives the error message in
msgbut never writes it to stderr before showing help. AddedUI.error(msg)beforecli.showHelp(show)so users see what argument was wrong.How did you verify your code works?
Ran
bun run ./src/index.ts --unknown-flagand confirmed the output now showsError: Unknown arguments: unknown-flagbefore the help text.Screenshots / recordings
N/A — CLI change only
Checklist