summaryrefslogtreecommitdiff
path: root/xmake/modules/utils/progress.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/utils/progress.lua')
-rw-r--r--xmake/modules/utils/progress.lua15
1 files changed, 12 insertions, 3 deletions
diff --git a/xmake/modules/utils/progress.lua b/xmake/modules/utils/progress.lua
index 8d7ab53f3..ac9c1e8f6 100644
--- a/xmake/modules/utils/progress.lua
+++ b/xmake/modules/utils/progress.lua
@@ -375,8 +375,11 @@ function _get_target_name_prefix(progress)
end
end
--- set the associated target name for the progress object (coroutine-local)
--- it's safe to call with non-table progress (e.g. number), it will be ignored
+-- set the associated target name for the progress display
+--
+-- @param progress the progress object or number
+-- @param target the target instance
+--
function set_target(progress, target)
if _is_show_target_enabled() and type(progress) == "table" and progress.set then
progress:set("target_name", target:fullname())
@@ -510,7 +513,13 @@ function show_abort()
end
end
--- get the message text with progress
+-- get the formatted message text with progress (without printing)
+--
+-- @param progress the progress value (0 ~ 100)
+-- @param format the format string
+-- @param ... the format arguments
+-- @return the formatted text string
+--
function text(progress, format, ...)
local target_prefix = _get_target_name_prefix(progress)
if target_prefix then