Added descriptions to commands.

This commit is contained in:
Max Klaversma
2014-05-01 01:41:19 +02:00
committed by Steffen Schröder
parent 490c9b81af
commit d2021d689e
12 changed files with 217 additions and 67 deletions

View File

@ -44,13 +44,14 @@ class CommandManager implements CallbackListener {
* @param CommandListener $listener
* @param string $method
* @param bool $adminCommand
* @param string $description
* @return bool
*/
public function registerCommandListener($commandName, CommandListener $listener, $method, $adminCommand = false) {
public function registerCommandListener($commandName, CommandListener $listener, $method, $adminCommand = false, $description = '') {
if (is_array($commandName)) {
$success = true;
foreach($commandName as $command) {
if (!$this->registerCommandListener($command, $listener, $method, $adminCommand)) {
if (!$this->registerCommandListener($command, $listener, $method, $adminCommand, $description)) {
$success = false;
}
}
@ -78,7 +79,7 @@ class CommandManager implements CallbackListener {
}
//TODO description
$this->helpManager->registerCommand($command, $adminCommand, '');
$this->helpManager->registerCommand($command, $adminCommand, $description, get_class($listener) . '\\' . $method);
return true;
}