Unosquare
    Show / Hide Table of Contents

    Class ArgumentOptionAttribute

    Models an option specification. Based on CommandLine (Copyright 2005-2015 Giacomo Stelluti Scala and Contributors.).

    Inheritance
    Object
    ArgumentOptionAttribute
    Namespace: Swan.Parsers
    Syntax
    public sealed class ArgumentOptionAttribute : Attribute

    Constructors

    ArgumentOptionAttribute(Char)

    Initializes a new instance of the ArgumentOptionAttribute class.

    Declaration
    public ArgumentOptionAttribute(char shortName)
    Parameters
    Type Name Description
    Char shortName

    The short name of the option..

    ArgumentOptionAttribute(Char, String)

    Initializes a new instance of the ArgumentOptionAttribute class.

    Declaration
    public ArgumentOptionAttribute(char shortName, string longName)
    Parameters
    Type Name Description
    Char shortName

    The short name of the option.

    String longName

    The long name of the option or null if not used.

    ArgumentOptionAttribute(String)

    Initializes a new instance of the ArgumentOptionAttribute class.

    Declaration
    public ArgumentOptionAttribute(string longName)
    Parameters
    Type Name Description
    String longName

    The long name of the option.

    Properties

    DefaultValue

    Gets or sets mapped property default value.

    Declaration
    public object DefaultValue { get; set; }
    Property Value
    Type Description
    Object

    The default value.

    HelpText

    Gets or sets a short description of this command line option. Usually a sentence summary.

    Declaration
    public string HelpText { get; set; }
    Property Value
    Type Description
    String

    The help text.

    IsDefault

    Gets or sets the default argument.

    Declaration
    public bool IsDefault { get; set; }
    Property Value
    Type Description
    Boolean

    The default argument.

    LongName

    Gets long name of this command line option. This name is usually a single English word.

    Declaration
    public string LongName { get; }
    Property Value
    Type Description
    String

    The long name.

    Required

    Gets or sets a value indicating whether a command line option is required.

    Declaration
    public bool Required { get; set; }
    Property Value
    Type Description
    Boolean

    true if required; otherwise, false.

    Separator

    When applying attribute to IEnumerable<T> target properties, it allows you to split an argument and consume its content as a sequence.

    Declaration
    public char Separator { get; set; }
    Property Value
    Type Description
    Char

    ShortName

    Gets a short name of this command line option, made of one character.

    Declaration
    public string ShortName { get; }
    Property Value
    Type Description
    String

    The short name.

    Comments

    Back to top Copyright © 2017-2019 Unosquare