-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: suppress help on CLI failures #4976
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 5fa074d The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
console.log(''); | ||
yargs.showHelp(); | ||
console.log(''); | ||
if (err) errorRed(err.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we definitely want to cut this line? Can a command fail without throwing an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://yargs.js.org/docs/#api-reference-failfn-boolean
https://yargs.js.org/docs/#api-reference-showhelponfailenable-message
customizing the fail handler seems unnecessary and the existing branching in here doesnt really make sense to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
atm the help string is logged whether or not the error is related to a missing argument
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4976 +/- ##
=======================================
Coverage 77.53% 77.53%
=======================================
Files 103 103
Lines 2110 2110
Branches 190 190
=======================================
Hits 1636 1636
Misses 453 453
Partials 21 21
|
Description
Drive-by changes
Related issues
Backward compatibility
Testing