Skip to content

Display help despite missing required option#1091

Merged
shadowspawn merged 1 commit intotj:developfrom
shadowspawn:feature/display-help-despite-missing-option
Nov 11, 2019
Merged

Display help despite missing required option#1091
shadowspawn merged 1 commit intotj:developfrom
shadowspawn:feature/display-help-despite-missing-option

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