conditional option

Jan 10, 2012 at 2:25 PM

Is there a way to mark an option as only being allowed is second option is present?  The logic is like this:

If A exists B is allowed

If A does not exist B is not allowed

B does not have to exist

Jan 14, 2012 at 7:24 AM

Dear Paul,

for now the library supports only mutually exclusive options, but this is not your case.

You need some conditional evaluation actually not applicable in declarative way. Anyway your post, time allowing, could motivate me add a feature like this.

For now I suggest you to mark option both A and B as Required=false, assign pertinent default values and handle "by hand" the conditional statement after successful parsing.

Can be ok for now?

Regards,

Giacomo

Mar 26, 2014 at 6:52 PM
I have the same desire as Paul. I would like to define that command-line option if A is specified C is required and B is not allowed, if B is specified A & C are not allowed.