Class ValueOption

Namespace
Pixie.Options
Assembly
Pixie.dll

Helps build value options.

public static class ValueOption
Inheritance
ValueOption
Inherited Members

Methods

CreateInt32Option(OptionForm, int)

Creates a 32-bit signed integer option that takes a single form.

public static ValueOption<int> CreateInt32Option(OptionForm form, int defaultValue)

Parameters

form OptionForm

The 32-bit signed integer option's form.

defaultValue int

The default value for the option.

Returns

ValueOption<int>

A 32-bit signed integer option.

CreateInt32Option(IReadOnlyList<OptionForm>, int)

Creates a 32-bit signed integer option that takes a list of forms.

public static ValueOption<int> CreateInt32Option(IReadOnlyList<OptionForm> forms, int defaultValue)

Parameters

forms IReadOnlyList<OptionForm>

The 32-bit signed integer option's forms.

defaultValue int

The default value for the option.

Returns

ValueOption<int>

A 32-bit signed integer option.

CreateOption<T>(OptionForm, Func<OptionForm, string, ILog, T>, T)

Creates a typed option that takes a single form.

public static ValueOption<T> CreateOption<T>(OptionForm form, Func<OptionForm, string, ILog, T> parseArgument, T defaultValue)

Parameters

form OptionForm

The option's form.

parseArgument Func<OptionForm, string, ILog, T>

A function that parses the option's argument.

defaultValue T

The default value for the option.

Returns

ValueOption<T>

A typed option.

Type Parameters

T

The parsed value type.

CreateOption<T>(IReadOnlyList<OptionForm>, Func<OptionForm, string, ILog, T>, T)

Creates a typed option that takes a list of forms.

public static ValueOption<T> CreateOption<T>(IReadOnlyList<OptionForm> forms, Func<OptionForm, string, ILog, T> parseArgument, T defaultValue)

Parameters

forms IReadOnlyList<OptionForm>

The option's forms.

parseArgument Func<OptionForm, string, ILog, T>

A function that parses the option's argument.

defaultValue T

The default value for the option.

Returns

ValueOption<T>

A typed option.

Type Parameters

T

The parsed value type.

CreateStringOption(OptionForm, string)

Creates a string option that takes a single form.

public static ValueOption<string> CreateStringOption(OptionForm form, string defaultValue)

Parameters

form OptionForm

The string option's form.

defaultValue string

The default value for the option.

Returns

ValueOption<string>

A string option.

CreateStringOption(IReadOnlyList<OptionForm>, string)

Creates a string option that takes a list of forms.

public static ValueOption<string> CreateStringOption(IReadOnlyList<OptionForm> forms, string defaultValue)

Parameters

forms IReadOnlyList<OptionForm>

The string option's forms.

defaultValue string

The default value for the option.

Returns

ValueOption<string>

A string option.