only show commands in help that have a description

This commit is contained in:
Steffen Schröder 2014-05-15 15:13:58 +02:00
parent d5b6e16ccd
commit c2e1ca0938

View File

@ -48,7 +48,7 @@ class CommandManager implements CallbackListener {
* @param string $description * @param string $description
* @return bool * @return bool
*/ */
public function registerCommandListener($commandName, CommandListener $listener, $method, $adminCommand = false, $description = '') { public function registerCommandListener($commandName, CommandListener $listener, $method, $adminCommand = false, $description = null) {
if (is_array($commandName)) { if (is_array($commandName)) {
$success = true; $success = true;
foreach ($commandName as $command) { foreach ($commandName as $command) {
@ -74,8 +74,10 @@ class CommandManager implements CallbackListener {
$this->addListenerCallback($this->commandListeners, $listenerCallback, $command); $this->addListenerCallback($this->commandListeners, $listenerCallback, $command);
} }
//TODO description // TODO: description(?)
$this->helpManager->registerCommand($command, $adminCommand, $description, get_class($listener) . '\\' . $method); if ($description) {
$this->helpManager->registerCommand($command, $adminCommand, $description, get_class($listener) . '\\' . $method);
}
return true; return true;
} }