mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
simplify command help example
This commit is contained in:
parent
7df05df48f
commit
35e23a7cbc
@ -236,10 +236,9 @@ class Hello
|
||||
{
|
||||
$util = resolve(CommandInfoUtil::class);
|
||||
$commands = $util->get();
|
||||
$helps = [];
|
||||
foreach ($commands as $command) {
|
||||
$helps[] = $util->getHelp($command['id']);
|
||||
}
|
||||
$helps = array_map(static function ($command) use ($util) {
|
||||
return $util->getHelp($command['id']);
|
||||
}, $commands);
|
||||
array_unshift($helps, '帮助:');
|
||||
return implode("\n", $helps);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user