From dab91f526e43a1bd3f8b1e6a33dfc9c2be6b643d Mon Sep 17 00:00:00 2001 From: sunxyw Date: Tue, 3 May 2022 16:56:04 +0800 Subject: [PATCH] fix command help format --- src/ZM/Utils/CommandInfoUtil.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ZM/Utils/CommandInfoUtil.php b/src/ZM/Utils/CommandInfoUtil.php index 6d5f8539..4b849093 100644 --- a/src/ZM/Utils/CommandInfoUtil.php +++ b/src/ZM/Utils/CommandInfoUtil.php @@ -103,20 +103,20 @@ class CommandInfoUtil $lines[0][] = "<{$arg_name}: {$arg_info['type']}>"; } else { $buffer = "[{$arg_name}: {$arg_info['type']}"; - if ($arg_info['default'] !== null) { + if (!empty($arg_info['default'])) { $buffer .= " = {$arg_info['default']}"; } $lines[0][] = $buffer . ']'; } - $lines[1][] = "{$arg_name};{$arg_info['description']}"; + $lines[][] = "{$arg_name};{$arg_info['description']}"; } - $buffer = ''; + $buffer = []; foreach ($lines as $line) { - $buffer .= implode(' ', $line) . "\n"; + $buffer[] = implode(' ', $line); } - return $buffer; + return implode("\n", $buffer); } /**