aboutsummaryrefslogtreecommitdiff
path: root/bpkg/utility.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-04-12 07:34:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-04-15 09:57:58 +0200
commit5267c62f8c1f483c5348d4a2e498088a41c2e945 (patch)
tree9592af2b2a374e9d5924dd7c859e4069ec75c4fb /bpkg/utility.txx
parent306ad185e8d8f50923316bdd1b68ef9a3b1e50e6 (diff)
Implement in-process package configuration
Diffstat (limited to 'bpkg/utility.txx')
-rw-r--r--bpkg/utility.txx34
1 files changed, 34 insertions, 0 deletions
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 <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,
@@ -71,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()).