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
demand() ignores anything after --
#1732
Comments
@cspotcode I conceptually think of keys after I feel like this is really a problem with implicit arrays, which are a feature I don't love; since they create ambiguity between positionals and array arguments. If I could do it over, I think I'd suggest writing the above more like this:
Where each member of the array is explicit. And |
There's a setting called "greedy arrays" which I'd like to eventually consider defaulting to |
These comments aren't addressing the bug raised by this ticket. |
@cspotcode I suppose what I'm getting at is that, is that I feel this potentially falls in the category of relying on undocumented behavior, and I don't really want to enshrine the behavior, if I can convince you not to use the |
It affects YousefED/typescript-json-schema#362, so it's not actually my code that's using arrays. The behavior also crops up without using arrays, so it's pretty clearly a bug.
The filename could also be the same as a flag or option, and then you'd want EDIT: it could also be |
@cspotcode so the argument is that, if you're collecting positionals after Is the behavior the same for |
Here's an example:
https://runkit.com/cspotcode/5f4fe1f3c5d0c8001a637b54
With:
Complains: "Not enough non-option arguments: got 0, need at least 2"
An array option accepts multiple values. So to separate it from the demanded positionals, we use
--
.demand()
ignores all values after--
. Removingdemand()
shows that the values are--
are parsed correctly and included in the_
array.Does
demand
's deprecation mean this cannot be fixed?The text was updated successfully, but these errors were encountered: