showhelp: sort options allowed values

This commit is contained in:
Thomas Desveaux 2018-10-02 19:10:03 +02:00
parent 9a094b1a6b
commit a37b45ec01

View File

@ -50,6 +50,11 @@
printf(" --%-" .. length .. "s %s", trigger, description)
if (option.allowed) then
local function compareValue(a, b)
return a[1] < b[1]
end
table.sort(option.allowed, compareValue)
for _, value in ipairs(option.allowed) do
printf(" %-" .. length-1 .. "s %s", value[1], value[2])
end