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(cli): Report error if unwanted positional arguments are received #1100

Merged
merged 1 commit into from May 9, 2019

Conversation

coreyfarrell
Copy link
Member

This applies to check-coverage, instrument, merge and report. Passing
additional arguments will now cause the help script to be displayed and
an error exit code.

Unknown flags nyc report --unknown=1 are still not reported.
Reporting unknown flags would require additional work as
yargs.strict() causes unknown items from configuration to be reported,
including flags that are defined for the global command but not a
sub-command.

Fixes #401


Is this a breaking change? I lean towards no but can see the argument. Likely this will first be released to 15.0.0 anyways but I'm not sure if it should be noted under breaking changes in the changelog.

@coveralls
Copy link

coveralls commented May 6, 2019

Coverage Status

Coverage remained the same at 96.87% when pulling 364c742 on coreyfarrell:stricter-yargs into b3dfae8 on istanbuljs:master.

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.

This looks great. One minor request in the test code, and also can we make the commit message fix(cli): .. for the changelog? :)

test/nyc-integration.js Show resolved Hide resolved
@coreyfarrell coreyfarrell changed the title fix: Report error if unwanted positional arguments are received fix(cli): Report error if unwanted positional arguments are received May 9, 2019
This applies to check-coverage, instrument, merge and report.  Passing
additional arguments will now cause the help script to be displayed and
an error exit code.

Unknown flags `nyc report --unknown=1` are still not reported.
Reporting unknown flags would require additional work as
`yargs.strict()` causes unknown items from configuration to be reported,
including flags that are defined for the global command but not a
sub-command.

Fixes istanbuljs#401
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.

nyc report html should maybe tell users that it’s not what they want?
3 participants