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

fix: we shouldn't output help if we've printed a prior help-like message #847

Merged
merged 2 commits into from Apr 6, 2017

Conversation

bcoe
Copy link
Member

@bcoe bcoe commented Apr 1, 2017

we were accidentally printing the help text twice, if recommendations were made and exit = false.

Commands:
  goat

Options:
  --help  Show help                                                                        [boolean]

Did you mean goat?
Commands:
  goat

Options:
  --help  Show help                                                                        [boolean]

Let's not do this, it looks weird!

fixes #822

@bcoe bcoe requested a review from JaKXz April 1, 2017 00:48
Copy link
Member

@JaKXz JaKXz left a comment

Choose a reason for hiding this comment

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

One minor nit, but otherwise LGTM

test/yargs.js Outdated
.help()
.recommendCommands()

parser.parse('boat help', {}, function (_err, argv, output) {
Copy link
Member

Choose a reason for hiding this comment

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

It might be redundant, but shouldn't we check that error is null/falsy here? and shouldn't it be _argv since we're not using that arg?

Copy link
Member Author

Choose a reason for hiding this comment

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

@JaKXz 👍 done.

Copy link
Member

@JaKXz JaKXz left a comment

Choose a reason for hiding this comment

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

LGTM for GH's sake.

My nit about _argv should have been caught by eslint IIRC, unless that rule is disabled...

@bcoe bcoe merged commit 17e89bd into master Apr 6, 2017
@bcoe bcoe deleted the 822-fix branch April 6, 2017 04:41
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.

recommended command used in conjunction with --help prints twice
3 participants