-
Notifications
You must be signed in to change notification settings - Fork 91
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: print error message and the usage menu for an unknown command line argument #130
Conversation
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.
Nice work! Modifying the base package is creative and works perfectly. Generally, you want to be wary about doing this but in this situation I think it's okay.
I've left a couple comments to address before I approve. Also, the build is failing so you'll need to address that. It may just be because the linter is complaining about the use of var
. If that's the case, it actually would be good to add a test for this change.
87a3d1a
to
af538e8
Compare
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.
Just a couple more comments. Also, it looks like the test failure was just the linting error, so no test is currently exercising the new behavior. You should add a test in either the "errorHandling" or "optionHandling" test suite
67fc612
to
77e5f94
Compare
Codecov Report
@@ Coverage Diff @@
## master #130 +/- ##
=========================================
Coverage ? 92.82%
=========================================
Files ? 57
Lines ? 2133
Branches ? 0
=========================================
Hits ? 1980
Misses ? 153
Partials ? 0
Continue to review full report at Codecov.
|
ecf18e4
to
031cbda
Compare
…e argument - When an unknown option was present it would only print a single-line error message - Now it also prints the usage menu - modified-commander.js modifies the commander code - modified index.js file to include the modified-commander.js file. - added a test to exercising the new behavior.
b3745bb
to
7c1aba4
Compare
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.
Looks good! 👍
## [0.19.3](v0.19.2...v0.19.3) (2020-02-12) ### Bug Fixes * print usage menu for an unknown flag ([#130](#130)) ([def7dcc](def7dcc))
🎉 This PR is included in version 0.19.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
When an unsupported option is given, a single-line error is printed. Now, the usage menu is printed along with the single-line error.
Change:
Commander code was:
Now: