This commit is contained in:
2020-09-08 11:06:42 +08:00
parent 0111ddb3a9
commit f3444d8bdd
+8
View File
@@ -67,12 +67,20 @@ abstract class AbstractConsole extends Component
{ {
$name = $this->parameters->getCommandName(); $name = $this->parameters->getCommandName();
$this->parameters->set('commandList', $this->getCommandList()); $this->parameters->set('commandList', $this->getCommandList());
$help = 'help';
foreach ($this->commands as $command) { foreach ($this->commands as $command) {
if ($command->command == $help) {
$help = $command;
}
if ($command->command != $name) { if ($command->command != $name) {
continue; continue;
} }
return $command; return $command;
} }
if (is_object($help)) {
return $help;
}
return null; return null;
} }