diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-04-13 16:18:10 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-04-13 16:18:10 +0200 |
commit | 1fd63551d1eea54b65dd1d4cbb365c85876a1f19 (patch) | |
tree | 70139acbbd263a89766a1cebe339c3b0fcca39e4 /bpkg/utility.txx | |
parent | 617543ce7cbc706a0e49747be598a7f6a0f7f518 (diff) |
Improve diagnostics
Diffstat (limited to 'bpkg/utility.txx')
-rw-r--r-- | bpkg/utility.txx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/bpkg/utility.txx b/bpkg/utility.txx index 8bdd7ec..33bb711 100644 --- a/bpkg/utility.txx +++ b/bpkg/utility.txx @@ -59,6 +59,36 @@ namespace bpkg ops.push_back ("--no-progress"); } + template <typename... A> + void + print_b (const common_options& co, verb_b v, A&&... args) + { + process_path pp (search_b (co)); + + small_vector<const char*, 1> ops; + + // As in start_b() below. + // + string verb_arg; + map_verb_b (co, v, ops, verb_arg); + + if (co.diag_color ()) + ops.push_back ("--diag-color"); + + if (co.no_diag_color ()) + ops.push_back ("--no-diag-color"); + + process_print_callback ( + [] (const char* const args[], size_t n) + { + print_process (args, n); + }, + pp, + ops, + co.build_option (), + forward<A> (args)...); + } + template <typename O, typename E, typename... A> process start_b (const common_options& co, @@ -73,6 +103,8 @@ namespace bpkg { small_vector<const char*, 1> ops; + // NOTE: see print_b() above if changing anything here. + // // NOTE: see custom versions in system_package_manager* if adding // anything new here (search for search_b()). |