naugtur / npm-audit-resolver

Apache License 2.0
119 stars 28 forks source link

yarn --groups passthrough doesn't work with multiple groups #28

Closed Undistraction closed 2 years ago

Undistraction commented 4 years ago

Yarn supports a --groups flag for audit, allowing multiple groups to be passed in:

yarn --groups dependencies peerDependencies optionalDependencies

However the following:

resolve-audit --yarn --groups dependencies peerDependencies optionalDependencies

Appears to result in a re-ordering of the flags. This is audit-resolver's output:

>>>> yarn audit --json peerDependencies optionalDependencies --groups dependencies
naugtur commented 4 years ago

That might be a feature of the yargs parser. I knew pass-through is gonna cause trouble.

Sorry I took so long to notice this. Did you solve it by any chance?

Undistraction commented 3 years ago

@naugtur this is now fixed.

naugtur commented 3 years ago

Are you sure it's not just random? It depends on the order of arguments which is not guaranteed.

Also, if you're passing '--something argument' there should be no spaces in the argument or argument needs to be quoted. The convention is to repeat the --something for each argument in CMD utils I know of. So this example was a little odd to begin with.