Interface ICommand

Unit

Declaration

type ICommand = interface(IInterface)

Description

Interface representing a command that can be registered in CommandBuilder for later use by the user.

Attributes
GUID['{AD920381-6441-48B1-B035-19694D0417A2}']

Hierarchy

Overview

Methods

Public function GetName: string;
Public procedure SetName(const AValue: string);
Public function GetDescription: string;
Public procedure SetDescription(const AValue: string);
Public function GetCallback: TCommandCallback;
Public procedure SetCallback(AValue: TCommandCallback);
Public function GetConstraints: TCommandConstraints;
Public procedure SetConstraints(const AValue: TCommandConstraints);
Public function GetOption(const AIndex: string): IOption;
Public function GetOptions: TArray<IOption>;
Public function HasOptions: Boolean;
Public function AddOption(const AFlag, AName, ADescription: string; ANotAllowedFlags: TArray<string> = nil; AConstraint: TOptionConstraint = ocNoValue): IOption;

Properties

Public property Name: string read GetName write SetName;
Public property Description: string read GetDescription write SetDescription;
Public property Callback: TCommandCallback read GetCallback write SetCallback;
Public property Constraints: TCommandConstraints read GetConstraints write SetConstraints;
Public property Option[constAIndex:string]: IOption read GetOption;
Public property Options: TArray<IOption> read GetOptions;

Description

Methods

Public function GetName: string;
 
Public procedure SetName(const AValue: string);
 
Public function GetDescription: string;
 
Public procedure SetDescription(const AValue: string);
 
Public function GetCallback: TCommandCallback;
 
Public procedure SetCallback(AValue: TCommandCallback);
 
Public function GetConstraints: TCommandConstraints;
 
Public procedure SetConstraints(const AValue: TCommandConstraints);
 
Public function GetOption(const AIndex: string): IOption;

Retrieves an option given the index provided as a parameter.

Parameters
AIndex
Desired option index position
Public function GetOptions: TArray<IOption>;

Function that returns the array of options defined for the command.

Public function HasOptions: Boolean;

Function that returns true if the command has at least one option configured.

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

Creates and adds the option to the command's list of options as given parameters.

Parameters
AFlag
Represents the option as a single letter, i.e. a short option
AName
Represents the option as a word, that is, a long option, it does not accept spaces, but "-' can be used for compound names. Ex: no-build
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 Name: string read GetName write SetName;

Name of the command that will be used via the command line by the user.

Public property Description: string read GetDescription write SetDescription;

Description of the command that best describes its purpose. It can be displayed to the user when he requests help information for the application.

Public property Callback: TCommandCallback read GetCallback write SetCallback;

Procedure that will be invoked by the builder after validation of the arguments provided by the user and the correct match of this command as the requested one.

Public property Constraints: TCommandConstraints read GetConstraints write SetConstraints;

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

Public property Option[constAIndex:string]: IOption read GetOption;

Retrieves an option given the index provided as a parameter.

Parameters
AIndex
Desired option index position
Public property Options: TArray<IOption> read GetOptions;

Property that returns the array of options defined for the command.


Generated by PasDoc 0.16.0.