Class TOption

Unit

Declaration

type TOption = class(TInterfacedObject, IOption)

Description

Class that implements the IOption interface that represents an option that can be configured as expected for a command.

Hierarchy

Overview

Methods

Public class function New(const AFlag, AName, ADescription: string; ANotAllowedFlags: TArray<string>; AConstraint: TOptionConstraint = ocNoValue): IOption;

Properties

Public property Flag: string read GetFlag write SetFlag;
Public property Name: string read GetName write SetName;
Public property Description: string read GetDescription write SetDescription;
Public property NotAllowedFlags: TArray<string> read GetNotAllowedFlags write SetNotAllowedFlags;
Public property Constraint: TOptionConstraint read GetConstraint write SetConstraint;
Public property Value: string read GetValue write SetValue;

Description

Methods

Public class function New(const AFlag, AName, ADescription: string; ANotAllowedFlags: TArray<string>; AConstraint: TOptionConstraint = ocNoValue): IOption;

Class factory recommended as first choice for class construction. Allows initialization with initial parameters.

Parameters
AFlag
Short option, accepts only a single letter. Do not use leading dash.
AName
Long option, accepts words, do not use leading dashes or spaces
ADescription
Description of the option that best defines your objective. It can be displayed to the user when the user requests information through the help command for example.
ANotAllowedFlags
Array of flags not supported for use in conjunction with this option. Only the short option without the "-" is accepted.
AConstraint
Option constraint that will be validated against the options provided by the user in order to guarantee that the command is being used correctly.

Properties

Public property Flag: string read GetFlag write SetFlag;

Represents the option as a single letter, i.e. a short option

Public property Name: string read GetName write SetName;

Represents the option as a word, that is, a long option, it does not accept spaces, but "-' can be used for compound names.

Public property Description: string read GetDescription write SetDescription;

Description of the option that best defines your objective. It can be displayed to the user when the user requests information through the help command for example.

Public property NotAllowedFlags: TArray<string> read GetNotAllowedFlags write SetNotAllowedFlags;

Array of flags not supported for use in conjunction with this option. Only the short option without the "-" is accepted.

Public property Constraint: TOptionConstraint read GetConstraint write SetConstraint;

Option constrains that will be validated against the options provided by the user in order to guarantee that the command is being used correctly.

Public property Value: string read GetValue write SetValue;

Returns the value of an option after parsing the parameters informed via the command line. The value of an option shoud be passed on right side of an equal sign after the option name or flag.


Generated by PasDoc 0.16.0.