summaryrefslogtreecommitdiff
path: root/xmake/core/base/deprecated.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-05-13 22:49:13 +0800
committerruki <[email protected]>2020-05-13 10:55:19 +0800
commitfca9ba9a046d4b6fc940b6a147528921a41e02a7 (patch)
tree92ebbc3656f662492d37fa47fe80153528fc9dd6 /xmake/core/base/deprecated.lua
parent33049b3e71655463b5975d9992cf9db6f0c5c693 (diff)
add wprint
Diffstat (limited to 'xmake/core/base/deprecated.lua')
-rw-r--r--xmake/core/base/deprecated.lua43
1 files changed, 5 insertions, 38 deletions
diff --git a/xmake/core/base/deprecated.lua b/xmake/core/base/deprecated.lua
index ec9ebacab..1d41389d8 100644
--- a/xmake/core/base/deprecated.lua
+++ b/xmake/core/base/deprecated.lua
@@ -24,46 +24,13 @@ local deprecated = deprecated or {}
-- add deprecated entry
function deprecated.add(newformat, oldformat, ...)
- -- the entries
- deprecated._ENTRIES = deprecated._ENTRIES or {}
-
- -- the old and new entries
+ local utils = require("base/utils")
local old = string.format(oldformat, ...)
local new = newformat and string.format(newformat, ...) or false
-
- -- add it
- deprecated._ENTRIES[old] = new
-end
-
--- dump all deprecated entries
-function deprecated.dump()
-
- -- lazy load modules to avoid loop
- local utils = require("base/utils")
- local option = require("base/option")
-
- -- dump one or more ..
- local index = 0
- deprecated._ENTRIES = deprecated._ENTRIES or {}
- for old, new in pairs(deprecated._ENTRIES) do
-
- -- trace
- if index == 0 then
- print("")
- end
-
- -- show more?
- if not option.get("verbose") and index > 0 then
- utils.cprint("${bright color.warning}deprecated:${clear} add -v for getting more ..")
- break
- end
-
- if new then
- utils.cprint("${bright color.warning}deprecated:${clear} please uses %s instead of %s", new, old)
- else
- utils.cprint("${bright color.warning}deprecated:${clear} please remove %s", old)
- end
- index = index + 1
+ if new then
+ utils.warning("%s is deprecated, please uses %s instead of it", old, new)
+ else
+ utils.warning("%s is deprecated, please remove it", old)
end
end