fix(opencode): output error message before help in .fail() handler - #31488
fix(opencode): output error message before help in .fail() handler#31488Btocode wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate PRs FoundI found two related PRs that appear to address the same issue:
Both PRs appear to be fixing the same issue: ensuring error messages are displayed to the user before or instead of the help text when invalid arguments are passed. PR #31228 seems to be the most recent attempt at this fix with very similar wording to the current PR #31488. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
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?
When passing an invalid argument like
--unknown-flag, the.fail()handler in yargs was callingcli.showHelp(show)but never output the error messagemsgto stderr. This meant the user saw the same output as--helpwith no indication of what they did wrong.The fix writes the error message to stderr before showing the help text, so the user sees e.g. "Unknown argument: --unknown-flag" followed by the help output.
How did you verify your code works?
msgcontains the error string andEOLis already importedprocess.stderr.write(...))Screenshots / recordings
N/A — CLI change only.
Checklist