-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Running CLI command with "-U" results in a message containing Did you mean "$0"
#9007
Comments
PR with a fix appreciated! |
Hey! Can I take this up? |
@rbrishabh go for it! |
@rbrishabh did you have a chance to look into it? If not I wouldn't mind taking a look at it. |
Hey @tonythetiger323, yes I'm looking into this. Will create a PR soon. |
I would like to work on this issue. |
I tried to reproduce your described error but if i run |
β Unrecognized CLI Parameter:
Unrecognized option "l". Did you mean "$0"?
CLI Options Documentation:
https://jestjs.io/docs/en/cli.html``` |
I did a quick analyze. If i understand correctly, the
When we pass the incorrect option (here It seems right given the fact the incorrect option is only one letter, the Maybe we should not suggest anything when the incorrect option has a length < 2 or something like that. I can provide a PR when we'll decide the expected bahavior. |
@thymikee I would love to take this up as my first issue. |
What @ghostd said. Plus, we could add a simple check if lowercasing a single letter would match with one of the valid options, but nothing more :) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
π Bug Report
Got this message when running CLI command with a bad parameter:
I seems to me that the message (
"$0"
) is wrong (looks like a misinterpreted regular expression replacement).To Reproduce
Launch jest cli command with
-U
instead of-u
Expected behavior
I think the message is supposed to say:
Unrecognized option "U". Did you mean "u"?
Link to repl or repo (highly encouraged)
N/A
envinfo
full command and result
The text was updated successfully, but these errors were encountered: