Search Results for

    Show / Hide Table of Contents

    Class CommandArgument

    Represents one or many positional command line arguments. Arguments are parsed in the order in which Arguments lists them.

    Inheritance
    System.Object
    CommandArgument
    CommandArgument<T>
    Namespace: McMaster.Extensions.CommandLineUtils
    Assembly: McMaster.Extensions.CommandLineUtils.dll
    Syntax
    public class CommandArgument

    Constructors

    | Improve this Doc View Source

    CommandArgument()

    Initializes a new instance of CommandArgument.

    Declaration
    public CommandArgument()

    Properties

    | Improve this Doc View Source

    Description

    A description of the argument.

    Declaration
    public string Description { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    MultipleValues

    Allow multiple values.

    Declaration
    public bool MultipleValues { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Name

    The name of the argument.

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    ShowInHelpText

    Determines if the argument appears in the generated help-text.

    Declaration
    public bool ShowInHelpText { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Validators

    A collection of validators that execute before invoking OnExecute(Func<Int32>). When validation fails, ValidationErrorHandler is invoked.

    Declaration
    public ICollection<IArgumentValidator> Validators { get; }
    Property Value
    Type Description
    System.Collections.Generic.ICollection<IArgumentValidator>
    | Improve this Doc View Source

    Value

    The first value from Values, if any.

    Declaration
    public string Value { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Values

    All values specified, if any.

    Declaration
    public List<string> Values { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    Extension Methods

    ValidationExtensions.IsRequired(CommandArgument, Boolean, String)
    ValidationExtensions.Accepts(CommandArgument, Action<IArgumentValidationBuilder>)
    ValidationExtensions.Accepts(CommandArgument)
    ValidationExtensions.OnValidate(CommandArgument, Func<ValidationContext, ValidationResult>)

    See Also

    CommandOption
    • Improve this Doc
    • View Source
    In This Article
    Back to top