Table of Contents

Namespace Webefinity.Switch

Classes

ArgumentDecimalProvider

A value provider that captures an unvalidated integer value.

ArgumentDirectoryProvider

Ensures that a directory is passed to an argument, and optionally that the directory exists.

ArgumentEnumProvider<TEnum>

A value provider that captures a string value and converts it to an enumeration value which is equivalent to that string value. Usage provides the string variants of each of your enum values automatically.

ArgumentFilenameProvider

A value provider that accepts a filename, and optionally validates that the file exists.

ArgumentFlagProvider

A true or false value provider. The true default causes this flag to be set if just the flag is passed, without the true or false value trailing it.

ArgumentLongProvider

A value provider that captures an unvalidated integer value.

ArgumentOption

The ArgumentOption is the definition of an option. It can define long and short versions of the flag, as in --long and -s. A value provider accepts the string in the field after the flag, and converts it to an appropriate value for the option. Once the argument is parsed by the ArgumentHandler, the value provider holds and serves the values of the parsed arguments.

You can use the fluent extensions to add a varierty of value providers, to mark the option as required, and to mark it as Default.

A default option can be passed as the first argument on the command line without the flag. This is a good way to handle commands.

ArgumentOptionExtensions

Fluid extensions that define value providers for options.

ArgumentStringProvider

A value provider that captures an unvalidated string value.

ArgumentsBuilder

A fluent builder for setting up options and their value providers.

ArgumentsHandler

Validates the arguments according to the list of options.

ValidationResult

Provides information about the validity of an individual command option, and the entire command line. Instances of the ValidationResult are combined by the ArgumentHandler using the Combine method.

Interfaces

IValueProvider

A value provider is stores and optionally validates the result of a switch when the value is parsed.

Set is called if an option is matched with the value passed to that option. The value can be converted into the target type by the provider, and stored as a nullable object. Later, GetValue can be called on the handler to retrieve the typed value of the option as passed.

You may implement your own value provider and add it to an option and apply it to an option during the build phase using: build.Add("switch").AddProvider(new MyCustomProvider());