Class OptionAttribute
- Namespace
- McMaster.Extensions.CommandLineUtils
- Assembly
- McMaster.Extensions.CommandLineUtils.dll
Represents one or many command line option that is identified by flag proceeded by '-' or '--'. Options are not positional. Compare to ArgumentAttribute.
[AttributeUsage(AttributeTargets.Property)]
public sealed class OptionAttribute : OptionAttributeBase
- Inheritance
-
objectAttributeOptionAttribute
- Inherited Members
Constructors
OptionAttribute()
Initializes a new OptionAttribute.
public OptionAttribute()
OptionAttribute(CommandOptionType)
Initializes a new OptionAttribute.
public OptionAttribute(CommandOptionType optionType)
Parameters
optionTypeCommandOptionTypeThe optionType
OptionAttribute(string)
Initializes a new OptionAttribute.
public OptionAttribute(string template)
Parameters
OptionAttribute(string, CommandOptionType)
Initializes a new OptionAttribute.
public OptionAttribute(string template, CommandOptionType optionType)
Parameters
templatestringThe template
optionTypeCommandOptionTypeThe option type
OptionAttribute(string?, string?, CommandOptionType)
Initializes a new OptionAttribute.
public OptionAttribute(string? template, string? description, CommandOptionType optionType)
Parameters
templatestringThe template
descriptionstringThe option description
optionTypeCommandOptionTypeThe option type
Properties
OptionType
Defines the type of the option. When not set, this will be inferred from the CLR type of the property.
public CommandOptionType? OptionType { get; set; }
Property Value
- See Also