\Cake\ConsoleConsoleInputSubcommand

An object to represent a single subcommand used in the command line.

Created when you call ConsoleOptionParser::addSubcommand()

Summary

Methods
Properties
Constants
__construct()
name()
getRawHelp()
help()
parser()
xml()
No public properties found
No constants found
No protected methods found
$_name
$_help
$_parser
N/A
No private methods found
No private properties found
N/A

Properties

$_name

$_name : string

Name of the subcommand

Type

string

$_help

$_help : string

Help string for the subcommand

Type

string

Methods

__construct()

__construct(string|array  $name, string  $help = '', \Cake\Console\ConsoleOptionParser|array|null  $parser = null) 

Make a new Subcommand

Parameters

string|array $name

The long name of the subcommand, or an array with all the properties.

string $help

The help text for this option.

\Cake\Console\ConsoleOptionParser|array|null $parser

A parser for this subcommand. Either a ConsoleOptionParser, or an array that can be used with ConsoleOptionParser::buildFromArray().

name()

name() : string

Get the value of the name attribute.

Returns

string —

Value of this->_name.

getRawHelp()

getRawHelp() : string

Get the raw help string for this command

Returns

string

help()

help(integer  $width) : string

Generate the help for this this subcommand.

Parameters

integer $width

The width to make the name of the subcommand.

Returns

string

parser()

parser() : \Cake\Console\ConsoleOptionParser|boolean

Get the usage value for this option

Returns

\Cake\Console\ConsoleOptionParser|boolean —

Either false or a ConsoleOptionParser

xml()

xml(\SimpleXMLElement  $parent) : \SimpleXMLElement

Append this subcommand to the Parent element

Parameters

\SimpleXMLElement $parent

The parent element.

Returns

\SimpleXMLElement —

The parent with this subcommand appended.