Method | Description | |
---|---|---|
__construct ( string $name ) | Constructor. | |
addArgument ( string $name, integer $mode = null, string $description = '', mixed $default = null ) | Adds a new command argument. | |
addOption ( string $name, string | array $shortcut = null, integer $mode = null, string $description = '', mixed $default = null ) | Adds a new command option. | |
getArguments ( ) : array | Gets the arguments registered. | |
getDescription ( ) : string | Returns the description for the command. | |
getHelp ( ) : string | Returns the help for the command. | |
getName ( ) : string | Gets the name of the command. | |
getOptions ( ) : array | Gets the options registered. | |
setDescription ( string $description ) : Command | Sets the description for the command. | |
setHelp ( string $help ) : Command | Sets the help for the command. |
public __construct ( string $name ) | ||
$name | string | The name of the command. e.g: "update" or with namespace "theme:update" |
public addArgument ( string $name, integer $mode = null, string $description = '', mixed $default = null ) | ||
$name | string | The argument name |
$mode | integer | The argument mode: self::REQUIRED or self::OPTIONAL |
$description | string | A description text |
$default | mixed | The default value (for self::OPTIONAL mode only) |
public addOption ( string $name, string | array $shortcut = null, integer $mode = null, string $description = '', mixed $default = null ) | ||
$name | string | The option name |
$shortcut | string | array | The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts |
$mode | integer | The option mode: One of the VALUE_* constants |
$description | string | A description text |
$default | mixed | The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE) |
public getArguments ( ) : array | ||
return | array | Each element is an array with the following signature: name, mode, description, default |
public getDescription ( ) : string | ||
return | string | The description for the command |
public getOptions ( ) : array | ||
return | array | Each element is an array with the following signature: name, shortcut, mode, description, default |
public setDescription ( string $description ) : Command | ||
$description | string | The description for the command |
return | Command | The current instance |