Pnpm: unknown arguments are silenced

Created on 25 Jul 2017  Â·  5Comments  Â·  Source: pnpm/pnpm

pnpm version: 1.8.1

Code to reproduce the issue:

pnpm install --foo # equivalent to `pnpm install`

Expected behavior:

failure with unknown argument foo

Actual behavior:

silence

help wanted S

Most helpful comment

I mean, if there is an unknown flag, pnpm could fail with an error. Though this would be a breaking change, so for now, we could maybe just print warnings.

Parsing of flags is done by nopt here: https://github.com/pnpm/pnpm/blob/master/src/main.ts#L145

Printing the warning should be done via @pnpm/logger. logger.warn('....'). You can find examples of warnings in code

@etamponi this is the issue I mentioned today when you mistyped --side-effects-cache.

All 5 comments

FYI, this is how npm behaves as well. Although might be good to have strict validation

I'd like to look into this issue. @zkochan can you elaborate on what you mean by, 'strict validation'?

I mean, if there is an unknown flag, pnpm could fail with an error. Though this would be a breaking change, so for now, we could maybe just print warnings.

Parsing of flags is done by nopt here: https://github.com/pnpm/pnpm/blob/master/src/main.ts#L145

Printing the warning should be done via @pnpm/logger. logger.warn('....'). You can find examples of warnings in code

@etamponi this is the issue I mentioned today when you mistyped --side-effects-cache.

this seems to be solved at first glance - or is something missing?

$ pnpm install --foo
 ERROR  Unknown option 'foo'
For help, run: pnpm help recursive

Yes, this was done.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MichalLytek picture MichalLytek  Â·  5Comments

andreypopp picture andreypopp  Â·  5Comments

jsumners picture jsumners  Â·  3Comments

vjpr picture vjpr  Â·  5Comments

Dmitry-N-Medvedev picture Dmitry-N-Medvedev  Â·  4Comments