Fr3nch13/CakePHP Utilities

ConsoleInputSubcommand
in package

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

Created when you call ConsoleOptionParser::addSubcommand()

Tags
see
ConsoleOptionParser::addSubcommand()

Table of Contents

Properties

$_help  : string
Help string for the subcommand
$_name  : string
Name of the subcommand
$_parser  : ConsoleOptionParser|null
The ConsoleOptionParser for this subcommand.

Methods

__construct()  : mixed
Make a new Subcommand
getRawHelp()  : string
Get the raw help string for this command
help()  : string
Generate the help for this this subcommand.
name()  : string
Get the value of the name attribute.
parser()  : ConsoleOptionParser|null
Get the usage value for this option
xml()  : SimpleXMLElement
Append this subcommand to the Parent element

Properties

Methods

__construct()

Make a new Subcommand

public __construct(array<string, mixed>|string $name[, string $help = '' ][, ConsoleOptionParser|array<string, mixed>|null $parser = null ]) : mixed
Parameters
$name : array<string, mixed>|string

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

$help : string = ''

The help text for this option.

$parser : ConsoleOptionParser|array<string, mixed>|null = null

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

getRawHelp()

Get the raw help string for this command

public getRawHelp() : string
Return values
string

help()

Generate the help for this this subcommand.

public help([int $width = 0 ]) : string
Parameters
$width : int = 0

The width to make the name of the subcommand.

Return values
string

name()

Get the value of the name attribute.

public name() : string
Return values
string

Value of this->_name.

xml()

Append this subcommand to the Parent element

public xml(SimpleXMLElement $parent) : SimpleXMLElement
Parameters
$parent : SimpleXMLElement

The parent element.

Return values
SimpleXMLElement

The parent with this subcommand appended.


        
On this page

Search results