From 4476d9d02ac7af21a7bc6ef92490491d308237f4 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 29 Apr 2020 22:20:21 +0300 Subject: Add --pkg-proxy common option --- bpkg/diagnostics.cxx | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'bpkg/diagnostics.cxx') 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 -#include -#include // operator<<(ostream, process_arg) +#include // process_args +#include // operator<<(ostream, process_*) #include @@ -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. -- cgit v1.1