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

Output failure message only once #273

Merged
merged 3 commits into from
Oct 4, 2015
Merged

Output failure message only once #273

merged 3 commits into from
Oct 4, 2015

Conversation

nexdrew
Copy link
Member

@nexdrew nexdrew commented Oct 1, 2015

Fixes issue #270 (concerning when .exitProcess(false) is used) by implementing the simplest solution mentioned in comment there.

Includes and satisfies test specs from PR #269.

@nexdrew
Copy link
Member Author

nexdrew commented Oct 1, 2015

@bcoe Got time for a quick review? 😁 For this and PR 271.

@bcoe
Copy link
Member

bcoe commented Oct 1, 2015

@nexdrew yes, consider the code review enqueued -- sorry that I've been so AWOL lately., can't wait to put some time into OSS.

@nexdrew
Copy link
Member Author

nexdrew commented Oct 1, 2015

@bcoe No worries. 🌴

@@ -28,17 +28,22 @@ module.exports = function (yargs, y18n) {
return self
}

var outputFailure = true
Copy link
Member

Choose a reason for hiding this comment

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

I'd be tempted to start the variable in a false state, just a personal preference when I'm using a variable as a flag. perhaps: failureOutput = false, and set it to true once you spit out an error -- just a minor nit feel free to ignore.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought of that, but then I noticed showHelpOnFail above defaults to true, so I figured it depended on the use-case. I also thought if (outputFailure) was easier to read/follow than if (!something). But I'm happy to change it if you'd like.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed with commit e61d536.

@bcoe
Copy link
Member

bcoe commented Oct 4, 2015

this is great :shipit:

@nexdrew
Copy link
Member Author

nexdrew commented Oct 4, 2015

I will merge once the build passes with the last commit.

nexdrew pushed a commit that referenced this pull request Oct 4, 2015
Output failure message only once
@nexdrew nexdrew merged commit 52504d9 into yargs:master Oct 4, 2015
@nexdrew nexdrew deleted the output-failure-once branch October 4, 2015 14:26
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.

3 participants