diff options
Diffstat (limited to 'xmake/modules/private/utils/progress.lua')
| -rw-r--r-- | xmake/modules/private/utils/progress.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/modules/private/utils/progress.lua b/xmake/modules/private/utils/progress.lua index eaf82c369..ad1402238 100644 --- a/xmake/modules/private/utils/progress.lua +++ b/xmake/modules/private/utils/progress.lua @@ -19,6 +19,7 @@ -- -- imports +import("core.base.option") import("core.base.object") import("core.theme.theme") @@ -88,6 +89,16 @@ function process:running() return self._RUNNING and true or false end +-- show the message with process +function show(progress, format, ...) + local progress_prefix = "${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} " + if option.get("verbose") then + cprint(progress_prefix .. "${dim}" .. format, progress, ...) + else + cprint(progress_prefix .. format, progress, ...) + end +end + -- build a progress indicator -- @params stream - stream to write to, will use io.stdout if not provided -- @params opt - options |
