-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] Parsing of flags with boolean & string values is incorrect. #6313
Comments
This has nothing to do w/ the |
Right. The reason I mentioned it is that this is how it might affect users currently and how to reproduce the issue without necessarily biasing towards any specific solution to the problem. |
Instead of trying to get boolean-and-string flags working, I think we're gonna add support for sets of mutually exclusive flags instead and then have things like |
Ok, Thanks that's much easier. I had a PR that proposed that very thing but was rejected. |
@ianlewis yeah I had that in mind too when I was thinking about this. The thing that PR is missing is the mechanism to couple the two configs together so they're mutually exclusive by way of a simple attribute on the config definition. You had it as an explicit check in one of the commands but this would need to be baked into the config definition. You were ultimately right in that the overloading was wrong, and since |
SG, thanks so much for following up on this. |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
The
npm fund
command has a--browser
flag which can benull
(not provided), a boolean value, or a string.However there are a number of things wrong with it.
npm fund --browser=open
should attempt to use the "open" command to open a browser. However the argument resolves to the valuetrue
and the system default is used.npm fund --browser --help
should parse the--help
flag but doesn't because it's treated as an argument to the--browser
flag.The end result is only boolean values can actually be input as all string values resolve to the boolean value
true
.Expected Behavior
npm fund --browser=open
should attempt to use the appropriate method to open the browser.npm fund --browser --help
should parse any flags after the--browser
flag as a flag rather than an argument to the--browser
flag.Steps To Reproduce
npm fund --browser=open
on a Linux system.xdg-open
is used to open the browser.Environment
The text was updated successfully, but these errors were encountered: