diff options
| author | ruki <[email protected]> | 2020-05-30 23:18:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-05-30 23:18:28 +0800 |
| commit | d50200be0abb94e7e627e7a25b5bab65d420eb16 (patch) | |
| tree | 06ab0407ff802bee7e9b7275df6081d657fe3609 /xmake/modules/private/utils/progress.lua | |
| parent | 8ee95c16390e8dbac222d1c0e665eb7dc43cccc7 (diff) | |
add progress.show
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 |
