summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/option.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-05-21 10:10:24 +0800
committerruki <[email protected]>2015-05-21 10:10:24 +0800
commit24e6b488718dab5dc58a7b4adc901884d716f478 (patch)
treea3963cc0d8ee123de1fcaacf9354e996401b06c3 /xmake/scripts/base/option.lua
parent111bd8e8cbf0c3b242ed3b137415d9560c4aac37 (diff)
list plats and archs for options
Diffstat (limited to 'xmake/scripts/base/option.lua')
-rw-r--r--xmake/scripts/base/option.lua42
1 files changed, 35 insertions, 7 deletions
diff --git a/xmake/scripts/base/option.lua b/xmake/scripts/base/option.lua
index 60b769dd8..7e3d963b4 100644
--- a/xmake/scripts/base/option.lua
+++ b/xmake/scripts/base/option.lua
@@ -442,16 +442,44 @@ function option.print_options(options)
-- print more description if exists
for i = 6, #option do
- if option[i] then
- -- make spaces
- local spaces = ""
- for i = 0, padding do
- spaces = spaces .. " "
+ -- the description
+ local description = option[i]
+ if description then
+
+ -- is function? get results
+ if type(description) == "function" then
+ description = description()
end
- -- print this description
- print(spaces .. option[i])
+ -- the description is string?
+ if type(description) == "string" then
+
+ -- make spaces
+ local spaces = ""
+ for i = 0, padding do
+ spaces = spaces .. " "
+ end
+
+ -- print this description
+ print(spaces .. description)
+
+ -- the description is table?
+ elseif type(description) == "table" then
+
+ -- print all descriptions
+ for _, v in pairs(description) do
+
+ -- make spaces
+ local spaces = ""
+ for i = 0, padding do
+ spaces = spaces .. " "
+ end
+
+ -- print this description
+ print(spaces .. v)
+ end
+ end
end
end
end