diff options
| author | ruki <[email protected]> | 2019-01-02 22:56:04 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-01-02 11:36:27 +0800 |
| commit | b183f6326762e3797ad65fe81051f1e03494e331 (patch) | |
| tree | 7305b48ff7d58870f70fa1e44a6ad473992936ac | |
| parent | 5190a07502ec7c962f0db3a628c0b05f3877cfff (diff) | |
use color.error and color.warning styles
| -rw-r--r-- | xmake/actions/config/main.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/install/main.lua | 4 | ||||
| -rw-r--r-- | xmake/actions/require/impl/action/download.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/require/impl/action/install.lua | 4 | ||||
| -rw-r--r-- | xmake/actions/require/impl/package.lua | 4 | ||||
| -rw-r--r-- | xmake/actions/uninstall/main.lua | 4 | ||||
| -rw-r--r-- | xmake/actions/update/main.lua | 4 | ||||
| -rw-r--r-- | xmake/core/base/deprecated.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/package/manager/apt/install.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/package/manager/pacman/install.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/package/manager/yum/install.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/private/platform/check_xcode.lua | 6 | ||||
| -rw-r--r-- | xmake/platforms/android/config.lua | 6 | ||||
| -rw-r--r-- | xmake/platforms/mingw/config.lua | 6 | ||||
| -rw-r--r-- | xmake/plugins/project/clang/compile_commands.lua | 2 | ||||
| -rw-r--r-- | xmake/themes/default/xmake.lua | 6 | ||||
| -rw-r--r-- | xmake/themes/plain/xmake.lua | 6 |
17 files changed, 39 insertions, 27 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index 03a274617..6fdf213b1 100644 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -160,7 +160,7 @@ function main() if not option.get("quiet") and not option.get("yes") then -- show tips - cprint("${bright yellow}note: ${default yellow}xmake.lua not found, try generating it (pass -y to skip confirm)?") + cprint("${color.warning}note: ${clear}xmake.lua not found, try generating it (pass -y to skip confirm)?") cprint("please input: n (y/n)") -- get answer diff --git a/xmake/actions/install/main.lua b/xmake/actions/install/main.lua index 76e114396..b8ff8131b 100644 --- a/xmake/actions/install/main.lua +++ b/xmake/actions/install/main.lua @@ -122,7 +122,7 @@ function main() end -- show tips - cprint("${bright red}error: ${default red}installation failed, may permission denied!") + cprint("${color.error}error: ${clear}installation failed, may permission denied!") -- continue to install with administrator permission? if sudo.has() then @@ -132,7 +132,7 @@ function main() if confirm == nil then -- show tips - cprint("${bright yellow}note: ${default yellow}try continue to install with administrator permission again?") + cprint("${color.warning}note: ${clear}try continue to install with administrator permission again?") cprint("please input: y (y/n)") -- get answer diff --git a/xmake/actions/require/impl/action/download.lua b/xmake/actions/require/impl/action/download.lua index 5f1c6f4bf..ed9c52bae 100644 --- a/xmake/actions/require/impl/action/download.lua +++ b/xmake/actions/require/impl/action/download.lua @@ -207,7 +207,7 @@ function main(package) -- verbose? if option.get("verbose") and errors then - cprint("${bright red}error: ${clear}%s", errors) + cprint("${color.verbose.error}error: ${clear}%s", errors) end -- trace diff --git a/xmake/actions/require/impl/action/install.lua b/xmake/actions/require/impl/action/install.lua index 82c9b7472..7955680c7 100644 --- a/xmake/actions/require/impl/action/install.lua +++ b/xmake/actions/require/impl/action/install.lua @@ -132,11 +132,11 @@ function main(package) -- verbose? if option.get("verbose") and errors then - cprint("${bright red}error: ${clear}%s", errors) + cprint("${color.verbose.error}error: ${clear}%s", errors) end -- trace - cprint("${red}failed") + cprint("${color.error}failed") -- failed if not package:requireinfo().optional then diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua index 22bb32358..c2b2f0617 100644 --- a/xmake/actions/require/impl/package.lua +++ b/xmake/actions/require/impl/package.lua @@ -334,7 +334,7 @@ function _get_confirm(packages) if confirm == nil then -- show tips - cprint("${bright yellow}note: ${default yellow}try installing these packages (pass -y to skip confirm)?") + cprint("${color.warning}note: ${clear}try installing these packages (pass -y to skip confirm)?") for _, package in ipairs(packages) do print(" -> %s %s %s", package:name(), package:version_str() or "", package:debug() and "(debug)" or "") end @@ -447,7 +447,7 @@ function install_packages(requires, opt) -- exists unsupported packages? if #packages_unsupported > 0 then -- show tips - cprint("${bright red}note: ${default red}the following packages are unsupported for $(plat)/$(arch)!") + cprint("${color.warning}note: ${clear}the following packages are unsupported for $(plat)/$(arch)!") for _, package in ipairs(packages_unsupported) do print(" -> %s %s", package:name(), package:version_str() or "") end diff --git a/xmake/actions/uninstall/main.lua b/xmake/actions/uninstall/main.lua index 30161c94f..bab865dc0 100644 --- a/xmake/actions/uninstall/main.lua +++ b/xmake/actions/uninstall/main.lua @@ -81,7 +81,7 @@ function main() end -- show tips - cprint("${bright red}error: ${default red}failed to uninstall, may permission denied!") + cprint("${color.error}error: ${clear}failed to uninstall, may permission denied!") -- continue to uninstall with administrator permission? if sudo.has() then @@ -91,7 +91,7 @@ function main() if confirm == nil then -- show tips - cprint("${bright yellow}note: ${default yellow}try continue to uninstall with administrator permission again?") + cprint("${color.warning}note: ${clear}try continue to uninstall with administrator permission again?") cprint("please input: y (y/n)") -- get answer diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua index 57cea27b2..54ad2b8fc 100644 --- a/xmake/actions/update/main.lua +++ b/xmake/actions/update/main.lua @@ -72,7 +72,7 @@ function _sudo(cmd) end -- show tips - cprint("\r${bright red}error: ${default red}run `%s` failed, may permission denied!", cmd) + cprint("\r${color.error}error: ${clear}run `%s` failed, may permission denied!", cmd) -- continue to install with administrator permission? if sudo.has() then @@ -82,7 +82,7 @@ function _sudo(cmd) if confirm == nil then -- show tips - cprint("\r${bright yellow}note: ${default yellow}try continue to run `%s` with administrator permission again?", cmd) + cprint("\r${color.warning}note: ${clear}try continue to run `%s` with administrator permission again?", cmd) cprint("\rplease input: y (y/n)") -- get answer diff --git a/xmake/core/base/deprecated.lua b/xmake/core/base/deprecated.lua index c041198a4..1c850ed89 100644 --- a/xmake/core/base/deprecated.lua +++ b/xmake/core/base/deprecated.lua @@ -61,11 +61,11 @@ function deprecated.dump() end -- trace - utils.cprint("${bright yellow}deprecated: ${default yellow}please uses %s instead of %s", new, old) + utils.cprint("${color.warning}deprecated: ${clear}please uses %s instead of %s", new, old) -- too much? if index > 6 and not option.get("verbose") then - utils.cprint("${bright yellow}deprecated: ${default yellow}add -v for getting more ..") + utils.cprint("${color.warning}deprecated: ${clear}add -v for getting more ..") break end diff --git a/xmake/modules/package/manager/apt/install.lua b/xmake/modules/package/manager/apt/install.lua index ca65a3b95..bf5c26817 100644 --- a/xmake/modules/package/manager/apt/install.lua +++ b/xmake/modules/package/manager/apt/install.lua @@ -59,7 +59,7 @@ function main(name, opt) if confirm == nil then -- show tips - cprint("${bright yellow}note: ${default yellow}try installing %s with administrator permission?", name) + cprint("${color.warning}note: ${clear}try installing %s with administrator permission?", name) cprint("please input: y (y/n)") -- get answer diff --git a/xmake/modules/package/manager/pacman/install.lua b/xmake/modules/package/manager/pacman/install.lua index 1240d7326..31196e69d 100644 --- a/xmake/modules/package/manager/pacman/install.lua +++ b/xmake/modules/package/manager/pacman/install.lua @@ -62,7 +62,7 @@ function main(name, opt) if confirm == nil then -- show tips - cprint("${bright yellow}note: ${default yellow}try installing %s with administrator permission?", name) + cprint("${color.warning}note: ${clear}try installing %s with administrator permission?", name) cprint("please input: y (y/n)") -- get answer diff --git a/xmake/modules/package/manager/yum/install.lua b/xmake/modules/package/manager/yum/install.lua index 731d3e51f..e5b8ef551 100644 --- a/xmake/modules/package/manager/yum/install.lua +++ b/xmake/modules/package/manager/yum/install.lua @@ -62,7 +62,7 @@ function main(name, opt) if confirm == nil then -- show tips - cprint("${bright yellow}note: ${default yellow}try installing %s with administrator permission?", name) + cprint("${color.warning}note: ${clear}try installing %s with administrator permission?", name) cprint("please input: y (y/n)") -- get answer diff --git a/xmake/modules/private/platform/check_xcode.lua b/xmake/modules/private/platform/check_xcode.lua index c86e3cb80..d56ed4c33 100644 --- a/xmake/modules/private/platform/check_xcode.lua +++ b/xmake/modules/private/platform/check_xcode.lua @@ -39,9 +39,9 @@ function main(config, optional) elseif not optional then -- failed - cprint("${bright red}please run:") - cprint("${red} - xmake config --xcode=xxx") - cprint("${red}or - xmake global --xcode=xxx") + cprint("${color.error}please run:") + cprint(" - xmake config --xcode=xxx") + cprint("or - xmake global --xcode=xxx") raise() end diff --git a/xmake/platforms/android/config.lua b/xmake/platforms/android/config.lua index 08e4ed0a5..a7f5d3c9b 100644 --- a/xmake/platforms/android/config.lua +++ b/xmake/platforms/android/config.lua @@ -40,9 +40,9 @@ function _check_ndk() config.set("gcc_toolchain", ndk.gcc_toolchain, {force = true, readonly = true}) else -- failed - cprint("${bright red}please run:") - cprint("${red} - xmake config --ndk=xxx") - cprint("${red}or - xmake global --ndk=xxx") + cprint("${color.error}please run:") + cprint(" - xmake config --ndk=xxx") + cprint("or - xmake global --ndk=xxx") raise() end end diff --git a/xmake/platforms/mingw/config.lua b/xmake/platforms/mingw/config.lua index b1d23030d..6ffbe3654 100644 --- a/xmake/platforms/mingw/config.lua +++ b/xmake/platforms/mingw/config.lua @@ -39,9 +39,9 @@ function _check_mingw() config.set("bin", mingw.bindir, {readonly = true, force = true}) else -- failed - cprint("${bright red}please run:") - cprint("${red} - xmake config --ndk=xxx") - cprint("${red}or - xmake global --ndk=xxx") + cprint("${color.error}please run:") + cprint(" - xmake config --ndk=xxx") + cprint("or - xmake global --ndk=xxx") raise() end end diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua index 020713c3d..448382434 100644 --- a/xmake/plugins/project/clang/compile_commands.lua +++ b/xmake/plugins/project/clang/compile_commands.lua @@ -71,7 +71,7 @@ function _make_single_object(jsonfile, target, sourcekind, sourcebatch) -- not supported now, ignore it directly for _, sourcefile in ipairs(table.wrap(sourcebatch.sourcefiles)) do - cprint("${bright yellow}warning: ${default yellow}ignore[%s]: %s", target:name(), sourcefile) + cprint("${color.warning}warning: ${clear}ignore[%s]: %s", target:name(), sourcefile) end end diff --git a/xmake/themes/default/xmake.lua b/xmake/themes/default/xmake.lua index a52ac5e14..6ba884dfd 100644 --- a/xmake/themes/default/xmake.lua +++ b/xmake/themes/default/xmake.lua @@ -30,3 +30,9 @@ theme("default") -- set color of the warning info set_color("warning", "bright yellow") + + -- set color of the verbose error info + set_color("verbose.error", "dim red") + + -- set color of the verbose warning info + set_color("verbose.warning", "dim yellow") diff --git a/xmake/themes/plain/xmake.lua b/xmake/themes/plain/xmake.lua index fea015678..667b4a0be 100644 --- a/xmake/themes/plain/xmake.lua +++ b/xmake/themes/plain/xmake.lua @@ -30,3 +30,9 @@ theme("plain") -- set color of the warning info set_color("warning", "") + + -- set color of the verbose error info + set_color("verbose.error", "") + + -- set color of the verbose warning info + set_color("verbose.warning", "") |
