command-line-args
command-line-args copied to clipboard
Throw an exception if both `lazyMultiple` and `multiple` are set
I know it's really an edge case since it can only happen when not reading the awesome documentation properly.
But since it's actually a contradiction according to the documentation and other similar things are also throwing an error, you might want to consider checking for this case and throwing an INVALID_DEFINITIONS error?
Alternatively it would make sense to just document which one wins, but if the issue is not reading docs... (hopefully this part doesn't already exist and I didn't spot it.)
When first skimming over the docs in the README, I assumed that I need to set both to have lazy, since multiple would be greedy by default.
Handling it this way, since it might be closer to the expected behaviour, could of course also be an option.
Hi, sorry for the delay. The multiple
and lazyMultiple
options are mutally exclusive - you should only set one of those options, not both. Yes, setting both options should throw an exception - I'll fix that.
Hi. I send a pull request to fix this issue. It works, there is also a simple test. Should i do something more? Im noob.