pkgjs / parseargs

Polyfill of `util.parseArgs()`
Apache License 2.0
121 stars 9 forks source link

disallow specifying multiple:true for boolean arguments #92

Closed bakkot closed 2 years ago

bakkot commented 2 years ago

multiple allows you to collect all the values for string arguments into an array. It doesn't do anything for boolean arguments. Best disallow it, I would think?

shadowspawn commented 2 years ago

Collecting an array of string arguments is the main use case, but an array of booleans can be used as an indirect counting feature. The classic use case is more verbose, like -vvv.

It doesn't do anything for boolean arguments. Best disallow it, I would think?

I think it does do something and no need to disallow? I do think of the boolean usage as somewhat of a side-affect of the string array support rather than a "real" feature, but in the absence of explicit support for counting options (which is not a common enough use case to have made the feature set), I think multiple is usable for that purpose.

bakkot commented 2 years ago

Oh, sorry I missed that conversation. If it's intentional, I'll just change this to be a test, then.