Class OptionDescriptor
The OptionDescriptor class defines the command option identity, data type, and data validation behavior. We also refer to options as command options or command flags.
public sealed class OptionDescriptor
- Inheritance
-
OptionDescriptor
- Inherited Members
Constructors
OptionDescriptor(string, string, string, OptionFlags, string?)
Initializes a new instance.
public OptionDescriptor(string id, string dataType, string description, OptionFlags flags, string? alias = null)
Parameters
id
stringThe option id.
dataType
stringThe option data type.
description
stringThe option description.
flags
OptionFlagsThe option flags.
alias
stringThe option alias.
Properties
Alias
The option alias.
public string? Alias { get; }
Property Value
Remarks
The option alias is unique within a command. Option alias supports the legacy apps that identified a command option with an id and an alias string. For modern console apps, we recommend using just an option identifier. The core data model is optimized to work with option id. In general, an app should not identify the same option with multiple strings.
DataType
The option data type.
public string DataType { get; }
Property Value
Description
The option description.
public string? Description { get; }
Property Value
Remarks
The option id is unique across all commands.
Flags
The option flags.
public OptionFlags Flags { get; }
Property Value
Id
The option id.
public string Id { get; }
Property Value
Remarks
The option id is unique within a command.
ValueCheckers
The option value checkers.
public IEnumerable<IValueChecker<Option>>? ValueCheckers { get; set; }