-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Undocumented behavior change since 2.x #1203
Comments
Quick response: I think this is due to changes from #599 for #395, released in Commander 3.0.0 https://github.com/tj/commander.js/releases/tag/v3.0.0 Can call like this for consistent behaviour across versions:
|
The implementation of option parsing is refined further in Commander v5, and the updated README description is:
Line 1015 in 3cf8cff
|
Hi, commander 5.0.0-4 does not fix the problem! Cheers, |
Following the doc:
It becomes a bug |
Drat, the new wording is not as clear as I hoped! The behaviour is as intended in Command 5, but I will recheck the source documentation for behaviour and wording of description. |
The standard I consult is: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html Commander is more flexible with optional values than described there, but Commander is deliberately supporting the pattern that a value can directly follow the short flag, from item 2:
And Guideline 5:
|
An answer was provided, and no further activity in a month. Closing this as resolved. Feel free to open a new issue if it comes up again, with new information and renewed interest. Thank you for your contributions. |
I think this behaviour change will be a problem for heavy users of optional values when they upgrade Commander, even though it is deliberate. Opened a PR to make it configurable. |
Hi,
this simple program has 2 different behavior depending on commander version:
Resuilt of
node test.js -dm --out
:Debug args: { debug: true, mangle: true, out: true }
Debug args: { debug: 'm', mangle: undefined, out: true }
This has strange effect when using uglify-js.
Cheers,
Xavier
The text was updated successfully, but these errors were encountered: