From 63ecc9139b29a21c0c812e9dca64dbdee2e5e725 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 3 Feb 2018 00:42:26 +0800 Subject: improve choice help menu --- xmake/core/base/option.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'xmake/core/base') diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua index 4037e6331..a6a87ad7c 100644 --- a/xmake/core/base/option.lua +++ b/xmake/core/base/option.lua @@ -1108,6 +1108,26 @@ function option.show_options(options) end end end + + -- print values + local values = opt.values + if type(values) == "function" then + values = values() + end + if values then + + for _, value in ipairs(table.wrap(values)) do + + -- make spaces + local spaces = "" + for i = 0, padding do + spaces = spaces .. " " + end + + -- print this value + print(option._inwidth_append(spaces, " - " .. tostring(value), padding + 1, console_width)) + end + end end end -- cgit v1.3.1