Class CommandOption<T>
Represents one or many command line option that is identified by flag proceeded by '-' or '--'.
Options are not positional. Compare to CommandArgument<T>. The raw value must be
parsable into type T
Inherited Members
Namespace: McMaster.Extensions.CommandLineUtils
Assembly: McMaster.Extensions.CommandLineUtils.dll
Syntax
public class CommandOption<T> : CommandOption, IInternalCommandParamOfT
Type Parameters
| Name | Description |
|---|---|
| T | The type of the option value(s) |
Constructors
| Improve this Doc View SourceCommandOption(IValueParser<T>, String, CommandOptionType)
Intializes a new instance of CommandOption<T>
Declaration
public CommandOption(IValueParser<T> valueParser, string template, CommandOptionType optionType)
Parameters
| Type | Name | Description |
|---|---|---|
| IValueParser<T> | valueParser | The parser use to convert values into type of T. |
| System.String | template | The option tempalte. |
| CommandOptionType | optionType | The optiont type |
Properties
| Improve this Doc View SourceParsedValue
The parsed value.
Declaration
public T ParsedValue { get; }
Property Value
| Type | Description |
|---|---|
| T |
ParsedValues
All parsed values;
Declaration
public IReadOnlyList<T> ParsedValues { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyList<T> |