EnumValidator

Input whitelist check.

Validates whenever input is contained in list of valid/accepted values.

Constructors

this
this(string[] values)

Creates new instance of EnumValidator

Members

Functions

validate
void validate(IEntry entry, string[] args)

Validates input

Variables

allowedValues
string[] allowedValues;

List of allowed values.

Inherited Members

From IValidator

validate
void validate(IEntry entry, string[] values)

Checks whenever specified input is valid.

Examples

new Program("test")
    .add(new Option("s", "scope", "working scope")
        .acceptsValues(["user", "system"])
    )

See Also

acceptsValues

Meta