-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add Yargs default and middleware logic to display helpful message during invalid arg/command calls #262
Conversation
@mikedotexe see here #259 (comment), I think we should do it differently, so that arguments are also validated. However feel free to merge it as a quick fix for now if full fix requires much more time. |
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.
This works. There is also a strict mode in yargs that we may use, but we need to be sure that all possible config options are documented as flags. I am ok landing this but consider the alternative first (example which didn't land here #51)
…ar’, basic error reporting and exiting
Hey folks, I have prefixed this PR with "WIP:" meaning work-in-progress. It's in a good state to start reviewing, I will make some minor changes. Result: |
@mikedotexe the issue you linked seems to have a solution: any reason why we cannot use it? if there is bug in yargs, I'd prefer we fix it vs reimplementing half of the logic ourselves |
The comment you mentioned uses I think I'm now understanding Jane's comment better and will look into the approach. |
What is the status with this PR? |
# Conflicts: # bin/near-cli.js # index.js
This approach becomes difficult with |
Regarding #259
Followed this from the yargs documentation.
Added a couple of cases where an argument, command, and multiple commands are entered an not understood. Provides end user with simple feedback and instructions.
Update: please see comments below regarding evolved approach