Reputation: 1
I would like to set an Option as "Required" if the value parsed from another Option is equal to a particular value. Is it possible to achieve that without having to post-process the parsed Options? Something like:
[Option('f', "foo", Required = true, HelpText = "Name of process")]
public string Foo{ get; set; }
[Option('b', "bar", Required = ( Foo == "egg" ), HelpText = "Name of process")]
public string Bar{ get; set; }
Upvotes: 0
Views: 596
Reputation: 124
Try this [RequiredIf(method/attribute, value)] instead of [Option]
Upvotes: 1