-
-
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
Error in the check for option name clash function in 6.0.0 #1308
Comments
The
|
Hello @shadowspawn , thanks for the answer, I do get now why I had something not undefined here line 451 and I got confused on the code's intent on line 464. Just to get with a little more context : the module using Commander and providing it with an 'opts' parameter is mocha-isolation https://www.npmjs.com/package/mocha-isolation |
Interesting. The deprecated
And in addition is using the global Command, so won't play well with other parts of program using Commander:
|
The new clash error is going to get hit when people upgrade with existing clashes that they didn't know about or worked around. We can try and improve the message if other people are confused too. |
An answer was provided, and it hasn't come up again in a month. Closing as resolved. Feel free to open a new issue if it comes up again, with new information and renewed interest. |
It seems to me that there is a bug in the new name clash feature. I do have a clash where there should be no.
I've added some logs to get inputs :
_checkForOptionNameClash :
Option : {"flags":"--opts ","required":true,"optional":false,"variadic":false,"mandatory":false,"long":"--opts","negate":false,"description":"specify opts path"}
Current this.options does not contain '--no-opts' -> this._findOption(negativeLongFlag) returns 'undefined'
!undefined -> foundClash = true -> throws 'Error: option 'opts' clashes with existing property 'opts' on Command'
So there is a clash whereas neither the positive no the negative option does exist.
Am I missing something ? It seems to be problematic to me.
The text was updated successfully, but these errors were encountered: