summaryrefslogtreecommitdiff
path: root/xmake/core/base/option.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-04-28 00:51:49 +0800
committerruki <[email protected]>2018-04-27 23:10:56 +0800
commit592503d59330402bdafe01559294236afc6a348c (patch)
treee057c4c8e8835f1bed36daf9ea0ed6a808e7b5d2 /xmake/core/base/option.lua
parenta8de3851db4596175bb259013b4fcab326961407 (diff)
add logo to help menu
Diffstat (limited to 'xmake/core/base/option.lua')
-rw-r--r--xmake/core/base/option.lua50
1 files changed, 50 insertions, 0 deletions
diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua
index 520a5f516..b4f09f43c 100644
--- a/xmake/core/base/option.lua
+++ b/xmake/core/base/option.lua
@@ -804,6 +804,50 @@ function option.defaults(task)
return defaults
end
+-- show logo
+function option.show_logo()
+
+ -- define logo
+ local logo = [[
+ _
+ __ ___ __ __ __ _| | ______
+ \ \/ / | \/ |/ _ | |/ / __ \
+ > < | \__/ | /_| | < ___/
+ /_/\_\_|_| |_|\__ \|_|\_\____|
+
+ by ruki, tboox.org
+ ]]
+
+ -- make rainbow for logo
+ if colors.truecolor() or colors.color256() then
+ local lines = {}
+ local seed = 236
+ for _, line in ipairs(logo:split("\n")) do
+ local i = 0
+ local line2 = ""
+ line:gsub(".", function (c)
+ local code = colors.truecolor() and colors.rainbow24(i, seed) or colors.rainbow256(i, seed)
+ line2 = string.format("%s${%s}%s", line2, code, c)
+ i = i + 1
+ end)
+ table.insert(lines, line2)
+ end
+ logo = table.concat(lines, "\n")
+ end
+
+ -- show logo
+ print(colors.translate(logo))
+
+ -- define footer
+ local footer = [[
+ ${point_right} ${bright}Manual${clear}: ${underline}http://xmake.io/#/home${clear}
+ ${pray} ${bright}Donate${clear}: ${underline}http://xmake.io/pages/donation.html#donate${clear}
+ ]]
+
+ -- show footer
+ print(colors.translate(footer))
+end
+
-- show the menu
function option.show_menu(task)
@@ -831,6 +875,9 @@ function option.show_menu(task)
print(colors.translate(menu.copyright))
end
+ -- show logo
+ option.show_logo()
+
-- print usage
if taskmenu.usage then
print("")
@@ -870,6 +917,9 @@ function option.show_main()
print(colors.translate(menu.copyright))
end
+ -- show logo
+ option.show_logo()
+
-- print usage
if main.usage then
print("")