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

Incorrect error message if flag passed before first command. #2943

Closed
merriam opened this issue Mar 17, 2017 · 2 comments
Closed

Incorrect error message if flag passed before first command. #2943

merriam opened this issue Mar 17, 2017 · 2 comments

Comments

@merriam
Copy link

merriam commented Mar 17, 2017

Do you want to request a feature or report a bug?
bug

What is the current behavior?
I get the incorrect and cryptic error message for passing a command line parameter before the command. I should get an error such as error: flag (-D) passed before first command. Run as yarn add -D ...

There is no need to guess and correct the command, which seems to be a flagellated deceased equine (See #635, #777, #716, #693, #1002, etc.). There is a need to put a correct error message. Currently, the error message includes Run "yarn add add ...." which is clearly incorrect.

If the current behavior is a bug, please provide the steps to reproduce.

$yarn -D add eslint-plugin-prefer-object-spread
yarn install v0.21.3
error `install` has been replaced with `add` to add new dependencies. Run "yarn add add eslint-plugin-prefer-object-spread --dev" instead.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

What is the expected behavior?

$yarn -D add eslint-plugin-prefer-object-spread
yarn install v0.21.3
error yarn option -D passed before a valid yarn command.   Run "yard add -D eslint-plugin-prefer-object-spread" instead.

Please mention your node.js, yarn and operating system version.
yarn v0.21.3, node v7.7.1, MacOS Sierra v10.12.3

@andimarek
Copy link

It seems to me that a solution for this has already been rejected once: #716

@merriam
Copy link
Author

merriam commented Mar 31, 2017

Yes. The solution of trying to divine the users intention and act on that guess was rejected.

The solution of printing a sensible error message should still be considered.

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

No branches or pull requests

3 participants