From 6f1ac61c711a6bfcadc3f9072a9b172fb0c244a3 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 29 May 2018 13:46:27 +0100 Subject: [PATCH] [Minor] Try to improve help message --- contrib/lua-argparse/argparse.lua | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) 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() -- 2.39.5