CliValidationExtensionsAddValidator(CliArgument, String, String) Method
Adds a validation pattern to an argument.
A validation pattern can be used to provide errors based on user input.
Namespace: DotMake.CommandLineAssembly: DotMake.CommandLine (in DotMake.CommandLine.dll) Version: 1.8.8
public static void AddValidator(
this CliArgument argument,
string validationPattern,
string validationMessage = null
)
- argument CliArgument
- The argument to configure.
- validationPattern String
- A regular expression pattern used for validation.
- validationMessage String (Optional)
- An error message to show when validationPattern does not match and validation fails.
In Visual Basic and C#, you can call this method as an instance method on any object of type
CliArgument. 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).