question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running CLI command with "-U" results in a message containing `Did you mean "$0"`

See original GitHub issue

🐛 Bug Report

Got this message when running CLI command with a bad parameter:

● Unrecognized CLI Parameter:
  Unrecognized option "U". Did you mean "$0"?

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

$ npm test -- -U

> <MyProject>@1.1.7 test <MyProjectPath>
> cross-env TZ=UTC NODE_ENV=test jest --ci "-U"

● Unrecognized CLI Parameter:

  Unrecognized option "U". Did you mean "$0"?

  CLI Options Documentation:
  https://jestjs.io/docs/en/cli.html

npm ERR! Test failed.  See above for more details.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thymikeecommented, Oct 6, 2020

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 😃

1reaction
iPawancommented, Jan 9, 2020
● Unrecognized CLI Parameter:

  Unrecognized option "l". Did you mean "$0"?

  CLI Options Documentation:
  https://jestjs.io/docs/en/cli.html```
Read more comments on GitHub >

github_iconTop Results From Across the Web

Command Line for Beginners – How to Use the Terminal Like ...
Hi everyone! In this article we'll take a good look at the command line (also known as the CLI, console, terminal or shell)....
Read more >
Special Characters and Quoting - Learning the bash ... - O'Reilly
Whether you use a backslash or a single quote, you are telling the shell to ignore the special meaning of the RETURN character....
Read more >
Linux set Command & How to Use it {9 Examples} - phoenixNAP
The set command is a built-in Linux shell command that displays and sets the names and values of shell and Linux environment variables....
Read more >
uniq Command in LINUX with examples - GeeksforGeeks
The uniq command in Linux is a command-line utility that reports or filters out the repeated lines in a file. In simple words,...
Read more >
Chapter 3. Special Characters
By itself on the command-line, file fails with an error message. Add a "-" for a more useful result. This causes the shell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found