command-line-args icon indicating copy to clipboard operation
command-line-args copied to clipboard

Throw an exception if both `lazyMultiple` and `multiple` are set

Open karfau opened this issue 5 years ago • 3 comments

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.)

karfau avatar Jan 13 '20 22:01 karfau

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.

karfau avatar Jan 13 '20 22:01 karfau

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.

75lb avatar Mar 10 '20 09:03 75lb

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.

Nerdman4U avatar Nov 15 '23 05:11 Nerdman4U