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

Allow command to override global strict #840

Merged
merged 3 commits into from Apr 15, 2017
Merged

Allow command to override global strict #840

merged 3 commits into from Apr 15, 2017

Conversation

zodern
Copy link
Contributor

@zodern zodern commented Mar 27, 2017

This adds a second argument to strict to disable it for a command.

@bcoe
Copy link
Member

bcoe commented Mar 28, 2017

@zodern thanks for the patch; I'm not seeing immediately why this additional configuration option is required. Could you provide some information about your specific use-case.

@zodern
Copy link
Contributor Author

zodern commented Mar 29, 2017

I want strict mode enabled for all commands except 2. Instead of enabling it individually for each command, this allows enabling it globally and disabling for individual commands.

Something similar was part of #734, but it was removed in #766.

@bcoe
Copy link
Member

bcoe commented Mar 30, 2017

@zodern gotcha, this makes sense to me now; I'd forgotten about the global option being the first parameter for strict.

I'd rather that we get rid of the global=true option; I don't think this is particularly useful now that options default to global; then we can make the first argument equivalent to enable/disable which feels more elegant.

This will be a breaking change; but this is fine.

@zodern
Copy link
Contributor Author

zodern commented Apr 5, 2017

@bcoe I removed the global option.

@bcoe
Copy link
Member

bcoe commented Apr 6, 2017

@zodern thank you 👍 will land this in an 8.x release; I'd like to potentially do a bit more house keeping on the 7.x branch first -- so might take a little while to merge.

Copy link
Member

@bcoe bcoe left a comment

Choose a reason for hiding this comment

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

@zodern thanks for the contribution.

@bcoe bcoe merged commit 6f78c05 into yargs:master Apr 15, 2017
@bcoe
Copy link
Member

bcoe commented May 2, 2017

@zodern this change is going out in the next version of yargs. I would love your help testing:

npm i yargs@next --save to try it out.

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