summaryrefslogtreecommitdiff
path: root/xmake/core/base/option.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-02-01 23:15:20 +0800
committerruki <[email protected]>2018-02-01 13:32:01 +0800
commitdc29eb443366d6ff754c7f0c05e51e7d1aab3c21 (patch)
tree2d418994d0244358127a92c2dfb37c909eb4a1c0 /xmake/core/base/option.lua
parent0ee92c0da0bfd6d9215622fedbd321aabf87f061 (diff)
improve console menu options
Diffstat (limited to 'xmake/core/base/option.lua')
-rw-r--r--xmake/core/base/option.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua
index 8d43fabe5..4037e6331 100644
--- a/xmake/core/base/option.lua
+++ b/xmake/core/base/option.lua
@@ -983,7 +983,22 @@ function option.show_options(options)
-- the padding spaces
local padding = 42
+ -- remove repeat empty lines
+ local emptyline_count = 0
+ local printed_options = {}
+ for _, opt in ipairs(options) do
+ if not opt[1] and not opt[2] then
+ emptyline_count = emptyline_count + 1
+ else
+ emptyline_count = 0
+ end
+ if emptyline_count < 2 then
+ table.insert(printed_options, opt)
+ end
+ end
+
-- print options
+ options = printed_options
for _, opt in ipairs(options) do
-- init the option info