HelpFormatter formats help for console shells. Can format to either text or XML formats. Uses ConsoleOptionParser methods to generate help.
Generally not directly used. Using $parser->help($command, 'xml'); is usually how you would access help. Or via the --help=xml
option on the command line.
Xml output is useful for integration with other tools like IDE's or other build tools.
string
Alias to display in the output.
int
The maximum number of arguments shown when generating usage.
int
The maximum number of options shown when generating usage.
\Cake\Console\ConsoleOptionParser
Option parser.
__construct(\Cake\Console\ConsoleOptionParser $parser)
Build the help formatter for an OptionParser
\Cake\Console\ConsoleOptionParser
$parser The option parser help is being generated for.
_generateUsage()
Generate the usage for a shell based on its arguments and options.
Usage strings favor short options over the long ones. and optional args will be indicated with []
string
_getMaxLength(array $collection)
Iterate over a collection and find the longest named thing.
array
$collection The collection to find a max length of.
int
setAlias(string $alias)
Set the alias
string
$alias The alias
text(int $width)
Get the help as formatted text suitable for output on the command line.
int
$width optional The width of the help output.
string
xml(bool $string)
Get the help as an XML string.
bool
$string optional Return the SimpleXml object or a string. Defaults to true.
string|\SimpleXMLElement
See $string
Alias to display in the output.
string
The maximum number of arguments shown when generating usage.
int
The maximum number of options shown when generating usage.
int
Option parser.
\Cake\Console\ConsoleOptionParser
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Console.HelpFormatter.html