nopt
nopt copied to clipboard
[BUG] --no-[parameterName] doesn't allow setting to null for some typeDefs
The purpose of "--no-myParam" is to allow setting a parameter to null instead of undefined, because "-myParam null" would set it to the string value 'null' instead of the javascript value null.
However, this feature is buggy for some typeDefs.
if typeDef is String "--no-myParam" the parse() function sets it to false instead of null However, clean() internally calls validateString() which changes it to 'false'
so, "--no-myParam" has no purpose in the case of typeDef String because i could have used "-myParam false" instead.
I haven't tested to see if the other typeDefs have similar issues, but it's possible.