From 5267c62f8c1f483c5348d4a2e498088a41c2e945 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 12 Apr 2023 07:34:39 +0200 Subject: Implement in-process package configuration --- bpkg/utility.txx | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'bpkg/utility.txx') diff --git a/bpkg/utility.txx b/bpkg/utility.txx index a21325c..33bb711 100644 --- a/bpkg/utility.txx +++ b/bpkg/utility.txx @@ -25,6 +25,8 @@ namespace bpkg } else if (verb == 1) { + // NOTE: search for verb_b usage if changing anything here. + // if (v != verb_b::normal) { ops.push_back ("-q"); @@ -57,6 +59,36 @@ namespace bpkg ops.push_back ("--no-progress"); } + template + void + print_b (const common_options& co, verb_b v, A&&... args) + { + process_path pp (search_b (co)); + + small_vector 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 (args)...); + } + template process start_b (const common_options& co, @@ -71,6 +103,8 @@ namespace bpkg { small_vector 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()). -- cgit v1.1