Skip to content
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

Display help despite missing required option #1091

Conversation

shadowspawn
Copy link
Collaborator

@shadowspawn shadowspawn commented Nov 9, 2019

Pull Request

Fixes #1089 #1092

Problem

When ask for help but there is a missing required option, getting error instead of help, so can't find out more.

e.g.

$ node test.js -h
error: required option '-s, --small' not specified

Solution

Check for missing required options after checking for displaying help. This fix covers help for commands with action handlers, and help on the main program.

(It does not cover program with a required option and calling help on an executable subcommand, which seems an unlikely case. Deal with it if and when it comes up.)

@shadowspawn shadowspawn mentioned this pull request Nov 10, 2019
Copy link
Collaborator

@abetomo abetomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shadowspawn
Copy link
Collaborator Author

Thanks @abetomo. I'll prepare a PR for a patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants