Commit 1d78d1b9 authored by lichtscheu's avatar lichtscheu

add functionality to allow hiding commands in /help command

parent b0833a89
......@@ -59,6 +59,13 @@ abstract class Command
*/
protected $usage = 'Command usage';
/**
* Show in Help
*
* @var bool
*/
protected $showInHelp = true;
/**
* Version
*
......@@ -252,6 +259,16 @@ abstract class Command
return $this->name;
}
/*
* Get Show in Help
*
* @return bool
*/
public function getShowInHelp()
{
return $this->showInHelp;
}
/**
* Check if command is enabled
*
......
......@@ -69,11 +69,13 @@ class HelpCommand extends UserCommand
);
foreach ($command_objs as $command) {
$text .= sprintf(
'/%s - %s' . PHP_EOL,
$command->getName(),
$command->getDescription()
);
if($command->getShowInHelp()) {
$text .= sprintf(
'/%s - %s' . PHP_EOL,
$command->getName(),
$command->getDescription()
);
}
}
$text .= PHP_EOL . 'For exact command help type: /help <command>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment