Class HelpFormatter
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.
Since: CakePHP(tm) v 2.0
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: Cake/Console/HelpFormatter.php
Properties summary
-
$_maxArgs
protectedinteger
The maximum number of arguments shown when generating usage. -
$_maxOptions
protectedinteger
The maximum number of options shown when generating usage.
Method Summary
-
__construct() public
Build the help formatter for a an OptionParser -
_generateUsage() 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 []
-
_getMaxLength() protected
Iterate over a collection and find the longest named thing. -
text() public
Get the help as formatted text suitable for output on the command line. -
xml() public
Get the help as an xml string.
Method Detail
__construct() public ¶
__construct( ConsoleOptionParser
$parser )
Build the help formatter for a an OptionParser
Parameters
-
ConsoleOptionParser
$parser - The option parser help is being generated for.
_generateUsage() protected ¶
_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 []
Returns
_getMaxLength() protected ¶
_getMaxLength( array $collection )
Iterate over a collection and find the longest named thing.
Parameters
- array $collection