From: Vsevolod Stakhov Date: Tue, 29 May 2018 12:46:27 +0000 (+0100) Subject: [Minor] Try to improve help message X-Git-Tag: 1.7.6~91 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6f1ac61c711a6bfcadc3f9072a9b172fb0c244a3;p=rspamd.git [Minor] Try to improve help message --- diff --git a/contrib/lua-argparse/argparse.lua b/contrib/lua-argparse/argparse.lua index 402f14a9b..48950a662 100644 --- a/contrib/lua-argparse/argparse.lua +++ b/contrib/lua-argparse/argparse.lua @@ -488,26 +488,15 @@ function Option:_get_label_lines() return {table.concat(self._aliases, ", ")} end - local longest_alias_length = -1 - - for _, alias in ipairs(self._aliases) do - longest_alias_length = math.max(longest_alias_length, #alias) - end - local argument_list_repr = table.concat(argument_list, " ") local lines = {} for i, alias in ipairs(self._aliases) do - local line = (" "):rep(longest_alias_length - #alias) .. alias .. " " .. argument_list_repr - - if i ~= #self._aliases then - line = line .. "," - end - + local line = alias .. " " .. argument_list_repr table.insert(lines, line) end - return lines + return {table.concat(lines, ", ")} end function Command:_get_label_lines()