Open ColinHebert opened 7 years ago
That is definitely an interesting example! I'm just not sure how much this adds over simply having a separate flag for each dump type, and then validating that at least one is set later on.
value.isEmpty()
is definitely nicer than !(heap || thread || database)
(especially when it's possible that more of these may be added later), but is it enough to warrant adding this to the API?
(I was actually somewhat on the fence about the existing mapping
method.)
Not sure whether it's something that should be part of the core of argparser but I came across a usecase which consists of multiple arguments (flags) being collected to obtain a set of switches (and allowing this set of switches to be validated).
I monkey patched it as this:
Here's an example of the usage:
What do you think?