lirantal / lockfile-lint

Lint an npm or yarn lockfile to analyze and detect security issues
Apache License 2.0
781 stars 35 forks source link

feat(cli): error on conflicting options #72

Closed lirantal closed 4 years ago

lirantal commented 4 years ago

Description

BREAKING CHANGE: CLI may show an error when arguments conflict and the order of short and long options was reversed to be more descriptive on CLI options errors.

Types of changes

Related Issue

64

lirantal commented 4 years ago

@XhmikosR unfortunately there doesn't seem to be any way to figure out which argument was used with yargs so even trying to set a custom failure message would not work.

The most improvement I could find at the moment is specifying the long name of the option instead of the short one, for which I also flipped them in the help/usage message.

I'll merge this as a breaking change to bump a major version.

codecov-io commented 4 years ago

Codecov Report

Merging #72 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #72   +/-   ##
=======================================
  Coverage   95.08%   95.08%           
=======================================
  Files          11       11           
  Lines         183      183           
  Branches       29       29           
=======================================
  Hits          174      174           
  Misses          8        8           
  Partials        1        1
Impacted Files Coverage Δ
...s/lockfile-lint-api/src/validators/ValidateHost.js 100% <100%> (ø) :arrow_up:
...lockfile-lint-api/src/validators/ValidateScheme.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 53d57ba...f773455. Read the comment docs.

XhmikosR commented 4 years ago

@lirantal no worries, thanks for looking into it :)

PS. it does sound weird that you can't access the used arg, but I haven't spent a lot of time with yargs to be able to help

lirantal commented 4 years ago

I'll merge this in as a major change anyway and I also pinged @bcoe for his take on the yargs setup. We can always push a fix if we find a better way and friendlier way.