Search Results for

    Show / Hide Table of Contents

    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

    Inheritance
    System.Object
    CommandOption
    CommandOption<T>
    Inherited Members
    CommandOption.ShortName
    CommandOption.LongName
    CommandOption.SymbolName
    CommandOption.ValueName
    CommandOption.Description
    CommandOption.Values
    CommandOption.OptionType
    CommandOption.ShowInHelpText
    CommandOption.Inherited
    CommandOption.Validators
    CommandOption.TryParse(String)
    CommandOption.HasValue()
    CommandOption.Value()
    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 Source

    CommandOption(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 Source

    ParsedValue

    The parsed value.

    Declaration
    public T ParsedValue { get; }
    Property Value
    Type Description
    T
    | Improve this Doc View Source

    ParsedValues

    All parsed values;

    Declaration
    public IReadOnlyList<T> ParsedValues { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<T>

    Extension Methods

    ValidationExtensions.IsRequired(CommandOption, Boolean, String)
    ValidationExtensions.IsRequired<T>(CommandOption<T>, Boolean, String)
    ValidationExtensions.Accepts(CommandOption, Action<IOptionValidationBuilder>)
    ValidationExtensions.Accepts(CommandOption)
    ValidationExtensions.Accepts<T>(CommandOption<T>, Action<IOptionValidationBuilder<T>>)
    ValidationExtensions.Accepts<T>(CommandOption<T>)
    ValidationExtensions.OnValidate(CommandOption, Func<ValidationContext, ValidationResult>)
    • Improve this Doc
    • View Source
    In This Article
    Back to top