From 0dc03d406a9958adb27ff49f568685f6e80f01ce Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Feb 2018 10:29:03 +0200 Subject: Add progress to dist meta-operation --- build2/diagnostics.hxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'build2/diagnostics.hxx') diff --git a/build2/diagnostics.hxx b/build2/diagnostics.hxx index b9757d6..5ec2ef0 100644 --- a/build2/diagnostics.hxx +++ b/build2/diagnostics.hxx @@ -143,6 +143,22 @@ namespace build2 os.iword (stream_verb_index) = static_cast (v.value_) + 1; } + // Progress reporting. + // + using butl::diag_progress; + using butl::diag_progress_lock; + + // Return true if progress is to be shown. The max_verb argument is the + // maximum verbosity level that this type of progress should be shown by + // default. + // + inline bool + show_progress (uint16_t max_verb) + { + return ops.progress () || + (stderr_term && verb >= 1 && verb <= max_verb && !ops.no_progress ()); + } + // Diagnostic facility, base infrastructure. // using butl::diag_stream_lock; -- cgit v1.1