CliValidationExtensionsAddValidator(CliOption, CliValidationRules) Method

Adds validation rules to an option's argument. Validation rules can be used to provide errors based on user input.

Definition

Namespace: DotMake.CommandLine
Assembly: DotMake.CommandLine (in DotMake.CommandLine.dll) Version: 1.8.8
C#
public static void AddValidator(
	this CliOption option,
	CliValidationRules validationRules
)

Parameters

option  CliOption
The option to configure.
validationRules  CliValidationRules
The validation rules to add.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type CliOption. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also