diff options
| author | ruki <[email protected]> | 2018-02-03 00:42:26 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-02-02 22:14:40 +0800 |
| commit | 63ecc9139b29a21c0c812e9dca64dbdee2e5e725 (patch) | |
| tree | 1bd0ae6bcb2cf411afd9da335adb9145ce2f7da3 /xmake/core/base/option.lua | |
| parent | 22e4a987e03ee6884da0b2cbb8a23397e7f17931 (diff) | |
improve choice help menu
Diffstat (limited to 'xmake/core/base/option.lua')
| -rw-r--r-- | xmake/core/base/option.lua | 20 |
1 files changed, 20 insertions, 0 deletions
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 |
