lithium\console\command\Help::_renderUsage()
Output the formatted usage.
Parameters
-
string
$command
The name of the command.
-
array
$method
Information about the method of the command to render usage for.
-
array
$properties
From
_properties()
.
Returns
voidSource
protected function _renderUsage($command, $method, $properties = []) {
$params = array_reduce($properties, function($a, $b) {
return "{$a} {$b['usage']}";
});
$args = array_reduce($method['args'], function($a, $b) {
return "{$a} {$b['usage']}";
});
$format = "{:command}li3 %s%s{:end}{:command}%s{:end}{:option}%s{:end}";
$name = $method['name'] == 'run' ? '' : " {$method['name']}";
$this->out($this->_pad(sprintf($format, $command ?: 'COMMAND', $name, $params, $args)));
}