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