Displays help information for the current cliApplication.
Help is formatted to the current set console width. Supports
command help e.g. help
Help is generated from the commands and sub-commands that make up the current application. It can intelligently build parameters, values and display what is required vs. optional. For an example see the Scorpio CLI tool. This has extensive help for all commands including options, switches, required values etc.
This class replaces the previous cliHelp.
// add help output to any application
$oApp = new cliApplication('example', 'A simple example.');
$oRequest = cliRequest::getInstance()->setApplication($oApp);
$oApp->getCommandChain()
->addCommand(
new cliCommandHelp($oRequest)
)
$oApp->execute($oRequest);
public __construct($inRequest)
Creates a new help command
public execute()
Figures out what to display based on the request. If help
public showHelp([$inCommand = null], [$inParent = null])
Displays a help message if the application is run with no parameters
public showNotes()
Displays notes about commands and switches
public displayArguments($inCommand, [$inPrefix = null])
Creates a preformatted set of text that can be echoed to the command line
Tags: cli, clicommand, clicommandhelp,
cli Articles