summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-03-21 22:54:36 +0800
committerruki <[email protected]>2019-03-21 11:27:41 +0800
commitc2b48d95274e056ac4158b9b7b38c78911164681 (patch)
treed73c6f9516e0106edd41483bfef11b2ecc3df300
parent160c2b1ad6105fa330c5a98aedf8818299915f1d (diff)
improve print info
-rw-r--r--xmake/core/sandbox/modules/os.lua16
-rw-r--r--xmake/core/sandbox/modules/utils.lua4
2 files changed, 10 insertions, 10 deletions
diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua
index fa0502318..0dcc98ef4 100644
--- a/xmake/core/sandbox/modules/os.lua
+++ b/xmake/core/sandbox/modules/os.lua
@@ -124,7 +124,7 @@ end
-- copy file or directory with the verbose info
function sandbox_os.vcp(...)
- if option.get("verbose") or option.get("diagnosis") then
+ if option.get("verbose") then
local srcfile, dstfile = ...
if srcfile and dstfile then
utils.cprint("${dim}> copy %s to %s ..", srcfile, dstfile)
@@ -135,7 +135,7 @@ end
-- move file or directory with the verbose info
function sandbox_os.vmv(...)
- if option.get("verbose") or option.get("diagnosis") then
+ if option.get("verbose") then
local srcfile, dstfile = ...
if srcfile and dstfile then
utils.cprint("${dim}> move %s to %s ..", srcfile, dstfile)
@@ -146,7 +146,7 @@ end
-- remove file or directory with the verbose info
function sandbox_os.vrm(...)
- if option.get("verbose") or option.get("diagnosis") then
+ if option.get("verbose") then
local file = ...
if file then
utils.cprint("${dim}> remove %s ..", file)
@@ -157,7 +157,7 @@ end
-- link file or directory with the verbose info
function sandbox_os.vln(...)
- if option.get("verbose") or option.get("diagnosis") then
+ if option.get("verbose") then
local srcfile, dstfile = ...
if srcfile and dstfile then
utils.cprint("${dim}> link %s to %s ..", srcfile, dstfile)
@@ -316,24 +316,24 @@ end
function sandbox_os.vrun(cmd, ...)
-- echo command
- if option.get("verbose") or option.get("diagnosis") then
+ if option.get("verbose") then
print(vformat(cmd, ...))
end
-- run it
- utils.ifelse(option.get("verbose") or option.get("diagnosis"), sandbox_os.exec, sandbox_os.run)(cmd, ...)
+ utils.ifelse(option.get("verbose"), sandbox_os.exec, sandbox_os.run)(cmd, ...)
end
-- quietly run command with arguments list and echo verbose info if [-v|--verbose] option is enabled
function sandbox_os.vrunv(program, argv, opt)
-- echo command
- if option.get("verbose") or option.get("diagnosis") then
+ if option.get("verbose") then
print(vformat(program), table.concat(argv, " "))
end
-- run it
- utils.ifelse(option.get("verbose") or option.get("diagnosis"), sandbox_os.execv, sandbox_os.runv)(program, argv, opt)
+ utils.ifelse(option.get("verbose"), sandbox_os.execv, sandbox_os.runv)(program, argv, opt)
end
-- run command and return output and error data
diff --git a/xmake/core/sandbox/modules/utils.lua b/xmake/core/sandbox/modules/utils.lua
index c665ad072..e1cee2482 100644
--- a/xmake/core/sandbox/modules/utils.lua
+++ b/xmake/core/sandbox/modules/utils.lua
@@ -145,14 +145,14 @@ end
-- print the verbose information
function sandbox_utils.vprint(format, ...)
- if option.get("verbose") or option.get("diagnosis") then
+ if option.get("verbose") then
sandbox_utils.print(format, ...)
end
end
-- print the verbose information without newline
function sandbox_utils.vprintf(format, ...)
- if option.get("verbose") or option.get("diagnosis") then
+ if option.get("verbose") then
sandbox_utils.printf(format, ...)
end
end