-
Notifications
You must be signed in to change notification settings - Fork 6
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
Unable to stop --catalogs
option from parsing filename
#117
Comments
I would also expect
I've not checked it, but from memory I think |
The reason that works is because there's nothing else for the option to grab when you write the command that way.
That's correct, it's valid. If it can be required that way, my thought here is that might be a more clear UX than the current. Similar to how Thanks for all your efforts. 👍 |
I had a bit of a dig into this. |
When I try to run something like:
v8r --catalogs catalog.json -- file.json
I get the help message, plus the error:
Not enough non-option arguments: got 0, need at least 1
I expected that it should be possible to put options before the filename positional argument, and indeed the following works:
v8r --catalogs catalog.json -v file.json
I suspect the error has something to do with the Yargs configuration. The
array()
docs state that it should be possible to indicate the end of an array of values with--
, but that doesn't seem to be working. Maybe it's a bug upstream?I also think the help message could be improved here. Most users aren't aware that
--
is how most CLI frameworks have users escape array option parsing. I think that should either be mentioned, or the default changed so that you have to specify--catalogs catalog1.json --catalogs catalog2.json
to use multiple catalogs, which feels like an uncommon case.The text was updated successfully, but these errors were encountered: