aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-03-10 09:40:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-03-10 09:40:06 +0200
commitd8acf937750958313b565e17eb33191e90dd4b36 (patch)
tree7970be18680da7b32784be401c9c47eb9248d523
parentd369ab42f2d3bc52086dc7d9b79510dce5e80513 (diff)
Map our verbosity level to bpkg
-rw-r--r--bdep/types.hxx2
-rw-r--r--bdep/utility.txx20
2 files changed, 20 insertions, 2 deletions
diff --git a/bdep/types.hxx b/bdep/types.hxx
index f4393ab..e31ab4b 100644
--- a/bdep/types.hxx
+++ b/bdep/types.hxx
@@ -26,6 +26,7 @@
#include <libbutl/process.mxx>
#include <libbutl/optional.mxx>
#include <libbutl/fdstream.mxx>
+#include <libbutl/small-vector.mxx>
namespace bdep
{
@@ -49,6 +50,7 @@ namespace bdep
using std::weak_ptr;
using std::vector;
+ using butl::small_vector; // <libbutl/small-vector.mxx>
using strings = vector<string>;
using cstrings = vector<const char*>;
diff --git a/bdep/utility.txx b/bdep/utility.txx
index 9256bc7..52bbfdb 100644
--- a/bdep/utility.txx
+++ b/bdep/utility.txx
@@ -27,10 +27,26 @@ namespace bdep
{
process_path pp (process::path_search (bpkg, exec_dir));
- // Forward our --build* options.
+ small_vector<const char*, 1> ops;
+
+ // Map verbosity level. If we are running quiet or at level 1, then run
+ // bpkg quiet. Otherwise, run it at the same level as us.
//
- cstrings ops;
+ bool quiet (false); // Maybe will become an argument one day.
+ string vl;
+ if (verb <= (quiet ? 1 : 0))
+ ops.push_back ("-q");
+ else if (verb == 2)
+ ops.push_back ("-v");
+ else if (verb > 2)
+ {
+ vl = to_string (verb);
+ ops.push_back ("--verbose");
+ ops.push_back (vl.c_str ());
+ }
+ // Forward our --build* options.
+ //
if (co.build_specified ())
{
ops.push_back ("--build");