diff options
| author | ruki <[email protected]> | 2016-07-14 08:30:08 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-07-14 08:30:08 +0800 |
| commit | e20c540cbde1694c683bbc3b8c19158bbde57985 (patch) | |
| tree | d7331ebdd2f7dc1f9efeea7f0862488ba77560fb | |
| parent | 375e6543b6ababe4dd84692456e71886cb857188 (diff) | |
add colors for actions and plugins
| -rwxr-xr-x | xmake/actions/build/main.lua | 2 | ||||
| -rwxr-xr-x | xmake/actions/config/main.lua | 2 | ||||
| -rwxr-xr-x | xmake/actions/create/main.lua | 4 | ||||
| -rwxr-xr-x | xmake/actions/global/main.lua | 3 | ||||
| -rwxr-xr-x | xmake/actions/install/main.lua | 2 | ||||
| -rwxr-xr-x | xmake/actions/package/main.lua | 2 | ||||
| -rwxr-xr-x | xmake/actions/uninstall/main.lua | 2 | ||||
| -rw-r--r-- | xmake/core/base/option.lua | 14 | ||||
| -rw-r--r-- | xmake/core/main.lua | 2 | ||||
| -rwxr-xr-x | xmake/plugins/doxygen/main.lua | 4 | ||||
| -rwxr-xr-x | xmake/plugins/macro/main.lua | 16 | ||||
| -rwxr-xr-x | xmake/plugins/project/main.lua | 2 |
12 files changed, 27 insertions, 28 deletions
diff --git a/xmake/actions/build/main.lua b/xmake/actions/build/main.lua index 6c27e8fb2..a11191b16 100755 --- a/xmake/actions/build/main.lua +++ b/xmake/actions/build/main.lua @@ -86,5 +86,5 @@ function main() os.cd(olddir) -- trace - print("build ok!") + cprint("${bright}build ok!") end diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index 3792dafed..2d3e1701f 100755 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -245,5 +245,5 @@ function main() _g.finished = true -- trace - print("configure ok!") + cprint("${bright}configure ok!") end diff --git a/xmake/actions/create/main.lua b/xmake/actions/create/main.lua index 64bf7d4d2..a07af9c27 100755 --- a/xmake/actions/create/main.lua +++ b/xmake/actions/create/main.lua @@ -32,11 +32,11 @@ function main() local targetname = option.get("target") or option.get("name") or path.basename(project.directory()) or "demo" -- trace - print("create %s ...", targetname) + cprint("${bright}create %s ...", targetname) -- create project from template template.create(option.get("language"), option.get("template"), targetname) -- trace - print("create ok!") + cprint("${bright}create ok!") end diff --git a/xmake/actions/global/main.lua b/xmake/actions/global/main.lua index a71a1d2ef..e44ada394 100755 --- a/xmake/actions/global/main.lua +++ b/xmake/actions/global/main.lua @@ -60,6 +60,5 @@ function main() global.dump() -- trace - print("configure ok!") - + cprint("${bright}configure ok!") end diff --git a/xmake/actions/install/main.lua b/xmake/actions/install/main.lua index 2358b330f..6246b5a3d 100755 --- a/xmake/actions/install/main.lua +++ b/xmake/actions/install/main.lua @@ -118,5 +118,5 @@ function main() end -- trace - print("install ok!") + cprint("${bright}install ok!") end diff --git a/xmake/actions/package/main.lua b/xmake/actions/package/main.lua index 0e6edfbae..257c88d3b 100755 --- a/xmake/actions/package/main.lua +++ b/xmake/actions/package/main.lua @@ -203,5 +203,5 @@ function main() end -- trace - print("package ok!") + cprint("${bright}package ok!") end diff --git a/xmake/actions/uninstall/main.lua b/xmake/actions/uninstall/main.lua index 35731d6c3..0930cd576 100755 --- a/xmake/actions/uninstall/main.lua +++ b/xmake/actions/uninstall/main.lua @@ -118,5 +118,5 @@ function main() end -- trace - print("uninstall ok!") + cprint("${bright}uninstall ok!") end diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua index 0ea6f5c97..88702c93f 100644 --- a/xmake/core/base/option.lua +++ b/xmake/core/base/option.lua @@ -863,13 +863,13 @@ function option.show_menu(task) -- print copyright if menu.copyright then - print(menu.copyright) + print(colors(menu.copyright)) end -- print usage if taskmenu.usage then print("") - print(colors("${bright}Usage: ${default cyan}" .. taskmenu.usage)) + print(colors("${bright}Usage: $${default cyan}" .. taskmenu.usage)) end -- print description @@ -902,13 +902,13 @@ function option.show_main() -- print copyright if menu.copyright then - print(menu.copyright) + print(colors(menu.copyright)) end -- print usage if main.usage then print("") - print(colors("${bright}Usage: ${default cyan}" .. main.usage)) + print(colors("${bright}Usage: $${default cyan}" .. main.usage)) end -- print description @@ -958,7 +958,7 @@ function option.show_main() -- print category name print("") - print(string.format("%s%ss: ", string.sub(categoryname, 1, 1):upper(), string.sub(categoryname, 2))) + print(colors(string.format("${bright}%s%ss: ", string.sub(categoryname, 1, 1):upper(), string.sub(categoryname, 2)))) -- the padding spaces local padding = 42 @@ -1010,7 +1010,7 @@ function option.show_options(options) -- print header print("") - print("Options: ") + print(colors("${bright}Options: ")) -- the padding spaces local padding = 42 @@ -1065,7 +1065,7 @@ function option.show_options(options) -- append the default value local default = opt[4] if default then - option_info = option_info .. " (default: " .. tostring(default) .. ")" + option_info = option_info .. " (default: ${bright}" .. tostring(default) .. "${clear})" end -- print option info diff --git a/xmake/core/main.lua b/xmake/core/main.lua index b8f12371c..654e3f564 100644 --- a/xmake/core/main.lua +++ b/xmake/core/main.lua @@ -40,7 +40,7 @@ local menu = title = xmake._VERSION .. ", The Make-like Build Utility based on Lua" -- copyright -, copyright = "Copyright (C) 2015-2016 Ruki Wang, tboox.org\nCopyright (C) 2005-2015 Mike Pall, luajit.org" +, copyright = "Copyright (C) 2015-2016 Ruki Wang, ${underline}tboox.org${clear}, ${underline}xmake.io${clear}\nCopyright (C) 2005-2015 Mike Pall, ${underline}luajit.org${clear}" -- the tasks: xmake [task] , task.menu diff --git a/xmake/plugins/doxygen/main.lua b/xmake/plugins/doxygen/main.lua index a2363d662..67813a5ae 100755 --- a/xmake/plugins/doxygen/main.lua +++ b/xmake/plugins/doxygen/main.lua @@ -111,6 +111,6 @@ function main() os.cd("-") -- trace - print("result: %s/html/index.html", outputdir) - print("doxygen ok!") + cprint("${bright green}result: ${default green}%s/html/index.html", outputdir) + cprint("${bright}doxygen ok!") end diff --git a/xmake/plugins/macro/main.lua b/xmake/plugins/macro/main.lua index 9a93c45b7..d0dbd7a6c 100755 --- a/xmake/plugins/macro/main.lua +++ b/xmake/plugins/macro/main.lua @@ -82,7 +82,7 @@ end function _list() -- trace - print("macros:") + cprint("${bright}macros:") -- find all macros for _, dir in ipairs(_directories()) do @@ -133,7 +133,7 @@ function _delete(macroname) end -- trace - print("delete macro(%s) ok!", macroname) + cprint("${bright}delete macro(%s) ok!", macroname) end -- import macro @@ -154,7 +154,7 @@ function _import(macrofile, macroname) os.cp(macrofile, _wfile(macroname)) -- trace - print("import macro(%s) ok!", macroname) + cprint("${bright}import macro(%s) ok!", macroname) end else @@ -162,7 +162,7 @@ function _import(macrofile, macroname) os.cp(macrofile, _wfile(macroname)) -- trace - print("import macro(%s) ok!", macroname) + cprint("${bright}import macro(%s) ok!", macroname) end end @@ -184,7 +184,7 @@ function _export(macrofile, macroname) os.cp(macrofile, outputdir) -- trace - print("export macro(%s) ok!", path.basename(macrofile)) + cprint("${bright}export macro(%s) ok!", path.basename(macrofile)) end end else @@ -192,7 +192,7 @@ function _export(macrofile, macroname) os.cp(_rfile(macroname), macrofile) -- trace - print("export macro(%s) ok!", macroname) + cprint("${bright}export macro(%s) ok!", macroname) end end @@ -274,7 +274,7 @@ function _end(macroname) _show(macroname) -- trace - print("define macro(%s) ok!", macroname) + cprint("${bright}define macro(%s) ok!", macroname) end -- run macro @@ -292,7 +292,7 @@ function _run(macroname) macro.main(option.get("arguments") or {}) -- trace - print("run macro(%s) ok!", macroname) + cprint("${bright}run macro(%s) ok!", macroname) end -- main diff --git a/xmake/plugins/project/main.lua b/xmake/plugins/project/main.lua index 06de449b4..850089b1e 100755 --- a/xmake/plugins/project/main.lua +++ b/xmake/plugins/project/main.lua @@ -70,5 +70,5 @@ function main() _make(option.get("kind")) -- trace - print("create ok!") + cprint("${bright}create ok!") end |
