diff options
| author | ruki <[email protected]> | 2019-05-25 22:27:46 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-05-25 22:27:46 +0800 |
| commit | 62e802d3d2bd954c7c101e0eaf792125e2f9e44d (patch) | |
| tree | 4bad2876a2ffcfc2facb17bf538a90d797349ae9 /xmake/core/base/utils.lua | |
| parent | 2cae1ff2dc7f1756a8a831cfde5c6610342f978f (diff) | |
improve confirm
Diffstat (limited to 'xmake/core/base/utils.lua')
| -rw-r--r-- | xmake/core/base/utils.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/base/utils.lua b/xmake/core/base/utils.lua index 03b2f4c36..c19987813 100644 --- a/xmake/core/base/utils.lua +++ b/xmake/core/base/utils.lua @@ -253,7 +253,11 @@ function utils.confirm(opt) if confirm == nil then -- show tips - utils.cprint("${bright color.warning}note: ${clear}%s (pass -y or --confirm=y/n/d to skip confirm)?", description) + if type(description) == "function" then + description() + else + utils.cprint("${bright color.warning}note: ${clear}%s (pass -y or --confirm=y/n/d to skip confirm)?", description) + end utils.cprint("please input: %s (y/n)", default and "y" or "n") -- get answer |
