Class TigerCliExactlyOneOfAttribute
Declares that exactly one of the listed option properties must be provided or resolved.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class TigerCliExactlyOneOfAttribute : Attribute
- Inheritance
-
TigerCliExactlyOneOfAttribute
- Inherited Members
Remarks
Apply this to a TigerCliSettings-derived class. Each named property must be a
TigerCliOptionAttribute property. Validation runs after prompting, so a value supplied
by an allowed prompt counts as present; in non-interactive mode no prompt fills missing values, so
none or multiple supplied options fail validation. The optional Description is used as
both the help note and the validation message.
Constructors
TigerCliExactlyOneOfAttribute(params string[])
Declares that exactly one of the specified settings properties must be provided.
public TigerCliExactlyOneOfAttribute(params string[] propertyNames)
Parameters
propertyNamesstring[]- Two or more property names (use
nameof(...)) that form the mutually exclusive group.
Properties
Description
Optional description override for the validation error and help note.
When null, a default message is generated from the option aliases.
public string? Description { get; set; }
Property Value
PropertyNames
The option property names that form the mutually exclusive group.
public string[] PropertyNames { get; }
Property Value
- string[]