From 6393d49cd57ff5d66c5535b3f6d6f8c22a7696f9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 5 Aug 2017 16:39:38 +0200 Subject: Add --match-only option --- build2/b.cxx | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'build2/b.cxx') diff --git a/build2/b.cxx b/build2/b.cxx index f2e45c3..1098da9 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -1186,8 +1186,11 @@ main (int argc, char* argv[]) // Run quiet. // - if (mif->match != nullptr) mif->match (mparams, a, tgs); - if (mif->execute != nullptr) mif->execute (mparams, a, tgs, true); + if (mif->match != nullptr) + mif->match (mparams, a, tgs); + + if (mif->execute != nullptr && !ops.match_only ()) + mif->execute (mparams, a, tgs, true); if (mif->operation_post != nullptr) mif->operation_post (mparams, pre_oid); @@ -1200,8 +1203,11 @@ main (int argc, char* argv[]) action a (mid, oid, 0); - if (mif->match != nullptr) mif->match (mparams, a, tgs); - if (mif->execute != nullptr) mif->execute (mparams, a, tgs, verb == 0); + if (mif->match != nullptr) + mif->match (mparams, a, tgs); + + if (mif->execute != nullptr && !ops.match_only ()) + mif->execute (mparams, a, tgs, verb == 0); if (post_oid != 0) { @@ -1217,8 +1223,11 @@ main (int argc, char* argv[]) // Run quiet. // - if (mif->match != nullptr) mif->match (mparams, a, tgs); - if (mif->execute != nullptr) mif->execute (mparams, a, tgs, true); + if (mif->match != nullptr) + mif->match (mparams, a, tgs); + + if (mif->execute != nullptr && !ops.match_only ()) + mif->execute (mparams, a, tgs, true); if (mif->operation_post != nullptr) mif->operation_post (mparams, post_oid); -- cgit v1.1