Search Results for

    Show / Hide Table of Contents

    Class OptionAttribute

    Represents one or many command line option that is identified by flag proceeded by '-' or '--'. Options are not positional. Compare to ArgumentAttribute.

    Inheritance
    System.Object
    System.Attribute
    OptionAttributeBase
    OptionAttribute
    Inherited Members
    OptionAttributeBase.Template
    OptionAttributeBase.ShortName
    OptionAttributeBase.LongName
    OptionAttributeBase.SymbolName
    OptionAttributeBase.ValueName
    OptionAttributeBase.Description
    OptionAttributeBase.ShowInHelpText
    OptionAttributeBase.Inherited
    System.Attribute.Equals(System.Object)
    System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Module)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.GetHashCode()
    System.Attribute.IsDefaultAttribute()
    System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
    System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
    System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.Module, System.Type)
    System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.Match(System.Object)
    System.Attribute.TypeId
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: McMaster.Extensions.CommandLineUtils
    Assembly: McMaster.Extensions.CommandLineUtils.dll
    Syntax
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public sealed class OptionAttribute : OptionAttributeBase

    Constructors

    | Improve this Doc View Source

    OptionAttribute()

    Initializes a new OptionAttribute.

    Declaration
    public OptionAttribute()
    | Improve this Doc View Source

    OptionAttribute(CommandOptionType)

    Initializes a new OptionAttribute.

    Declaration
    public OptionAttribute(CommandOptionType optionType)
    Parameters
    Type Name Description
    CommandOptionType optionType

    The optionType

    | Improve this Doc View Source

    OptionAttribute(Nullable<String>, Nullable<String>, CommandOptionType)

    Initializes a new OptionAttribute.

    Declaration
    public OptionAttribute(string? template, string? description, CommandOptionType optionType)
    Parameters
    Type Name Description
    System.Nullable<System.String> template

    The template

    System.Nullable<System.String> description

    The option description

    CommandOptionType optionType

    The option type

    | Improve this Doc View Source

    OptionAttribute(String)

    Initializes a new OptionAttribute.

    Declaration
    public OptionAttribute(string template)
    Parameters
    Type Name Description
    System.String template

    The string template. McMaster.Extensions.CommandLineUtils.CommandOption.Template.

    | Improve this Doc View Source

    OptionAttribute(String, CommandOptionType)

    Initializes a new OptionAttribute.

    Declaration
    public OptionAttribute(string template, CommandOptionType optionType)
    Parameters
    Type Name Description
    System.String template

    The template

    CommandOptionType optionType

    The option type

    Properties

    | Improve this Doc View Source

    OptionType

    Defines the type of the option. When not set, this will be inferred from the CLR type of the property. OptionType

    Declaration
    public CommandOptionType? OptionType { get; set; }
    Property Value
    Type Description
    System.Nullable<CommandOptionType>
    • Improve this Doc
    • View Source
    In This Article
    Back to top