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

Add showHelpAfterError #1534

Merged
merged 12 commits into from Jun 1, 2021

Conversation

shadowspawn
Copy link
Collaborator

@shadowspawn shadowspawn commented May 29, 2021

Pull Request

Problem

Some users would like the help displayed along with the error, or a tip that the help is available.

Related: #7 (comment) #482 #766 #919 #1423

Solution

Add .showHelpAfterError() to turn on displaying the help, and can optionally take a string to display (rather than the full help).

The form of the solution inspired in part by Yargs showHelpOnFail.

Example uses:

program.showHelpAfterError('(see --help for additional information)'); // custom suggestion

program.showHelpAfterError(); // display full command help after the error message

ChangeLog

  • add: .showHelpAfterError() to display full help or a custom message after an error
  • changed: remove help suggestion from "unknown command" error message (see .showHelpAfteError() )

@shadowspawn shadowspawn marked this pull request as draft May 29, 2021 02:13
@shadowspawn shadowspawn changed the title First cut at displayHelpWithError Add displayHelpWithError May 29, 2021
@shadowspawn shadowspawn changed the title Add displayHelpWithError Add showHelpWithError May 29, 2021
@shadowspawn shadowspawn changed the title Add showHelpWithError Add showHelpAfterError May 29, 2021
@shadowspawn shadowspawn marked this pull request as ready for review May 29, 2021 05:12
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

@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label Jun 1, 2021
@shadowspawn shadowspawn merged commit 082717f into tj:release/8.x Jun 1, 2021
@shadowspawn shadowspawn deleted the feature/displayHelpWithError branch June 1, 2021 07:04
@shadowspawn shadowspawn removed the pending release Merged into a branch for a future release, but not released yet label Jun 25, 2021
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.

None yet

2 participants