Table of Contents

Class OptionDescriptor

Namespace
OneImlx.Terminal.Commands
Assembly
OneImlx.Terminal.dll

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 string

The option id.

dataType string

The option data type.

description string

The option description.

flags OptionFlags

The option flags.

alias string

The option alias.

Properties

Alias

The option alias.

public string? Alias { get; }

Property Value

string

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

string

Description

The option description.

public string? Description { get; }

Property Value

string

Remarks

The option id is unique across all commands.

Flags

The option flags.

public OptionFlags Flags { get; }

Property Value

OptionFlags

Id

The option id.

public string Id { get; }

Property Value

string

Remarks

The option id is unique within a command.

ValueCheckers

The option value checkers.

public IEnumerable<IValueChecker<Option>>? ValueCheckers { get; set; }

Property Value

IEnumerable<IValueChecker<Option>>

See Also