aboutsummaryrefslogtreecommitdiff
path: root/bpkg/diagnostics.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/diagnostics.cxx')
-rw-r--r--bpkg/diagnostics.cxx29
1 files changed, 23 insertions, 6 deletions
diff --git a/bpkg/diagnostics.cxx b/bpkg/diagnostics.cxx
index 5b77e65..a471d07 100644
--- a/bpkg/diagnostics.cxx
+++ b/bpkg/diagnostics.cxx
@@ -7,8 +7,8 @@
#include <odb/statement.hxx>
-#include <libbutl/process.mxx>
-#include <libbutl/process-io.mxx> // operator<<(ostream, process_arg)
+#include <libbutl/process.mxx> // process_args
+#include <libbutl/process-io.mxx> // operator<<(ostream, process_*)
#include <bpkg/utility.hxx>
@@ -22,14 +22,31 @@ namespace bpkg
void
print_process (const char* const args[], size_t n)
{
- diag_record r (text);
- print_process (r, args, n);
+ diag_record dr (text);
+ print_process (dr, args, n);
}
void
- print_process (diag_record& r, const char* const args[], size_t n)
+ print_process (diag_record& dr, const char* const args[], size_t n)
{
- r << process_args {args, n};
+ dr << process_args {args, n};
+ }
+
+ void
+ print_process (const process_env& pe, const char* const args[], size_t n)
+ {
+ diag_record dr (text);
+ print_process (dr, pe, args, n);
+ }
+
+ void
+ print_process (diag_record& dr,
+ const process_env& pe, const char* const args[], size_t n)
+ {
+ if (pe.env ())
+ dr << pe << ' ';
+
+ dr << process_args {args, n};
}
// Diagnostics verbosity level.