Interface ICommand
Unit
Command.Interfaces
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
Properties
Description
Methods
|
function GetName: string; |
|
|
procedure SetName(const AValue: string); |
|
|
function GetDescription: string; |
|
|
procedure SetDescription(const AValue: string); |
|
|
function GetOption(const AIndex: string): IOption; |
Retrieves an option given the index provided as a parameter.
Parameters
- AIndex
- Desired option index position
|
|
function GetOptions: TArray<IOption>; |
Function that returns the array of options defined for the command.
|
|
function HasOptions: Boolean; |
Function that returns true if the command has at least one option configured.
|
|
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
|
property Name: string read GetName write SetName; |
Name of the command that will be used via the command line by the user.
|
|
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.
|
|
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.
|
|
property Option[constAIndex:string]: IOption read GetOption; |
Retrieves an option given the index provided as a parameter.
Parameters
- AIndex
- Desired option index position
|
|
property Options: TArray<IOption> read GetOptions; |
Property that returns the array of options defined for the command.
|
Generated by PasDoc 0.16.0.