Open jakub-g opened 1 year ago
In my case there was an accidental lack of space between two arguments, e.g. --foo opt1--baz opt2
which lead to a similar message despite both --foo
and --baz
being optional. The error message was basically 2 of the same alternate options:
Unknown Syntax Error: Command not found; did you mean one of:
0. /usr/local/bin/node /home/user/index.js my-command [--foo #0] [--baz #0]
1. /usr/local/bin/node /home/user/index.js my-command [--foo #0] [--baz #0]
Edit: Turns out the issue was a red herring, the CLI abstraction I was using passed a Bash substitution argument as a literal. I verified this by logging process.argv
and saw […, '--baz $(cat', 'file.txt)']
in the value received by the script. I adjusted the code to accept the file name as parameter directly without having the command interpreter reading it and it's working well since.
This is a followup of #101 (see my comment)
When the command
yarn cli foo
has arequired
paramand it's run without it, the error message is not great
I think in this case, the behavior should be the same as if
yarn cli foo --help
.