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.
$_maxArgs
protected integer
$_maxOptions
protected integer
$_parser
protected 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 []
__construct( Cake\Console\ConsoleOptionParser $parser )
Build the help formatter for an OptionParser
Cake\Console\ConsoleOptionParser
$parser
_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 []
_getMaxLength( array $collection )
Iterate over a collection and find the longest named thing.
$collection
text( integer $width 72 )
Get the help as formatted text suitable for output on the command line.
$width
optional 72 xml( boolean $string true )
Get the help as an xml string.
$string
optional true
© 2005–2017 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/3.4/class-Cake.Console.HelpFormatter.html