aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-01-15 09:59:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-01-15 09:59:55 +0200
commitf8a8b3f127712e93d9f408ef3a58f1342e3cd7d8 (patch)
treea944bad08a9a3aab91feda9ecfe274179f1d5b97 /libbuild2
parent8a0ebb2b607c92b8c1bdab7e525da2b711b31565 (diff)
Make sure --dump-{scope,target} are specified with --dump
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/b-cmdline.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/libbuild2/b-cmdline.cxx b/libbuild2/b-cmdline.cxx
index 77ad087..206c9de 100644
--- a/libbuild2/b-cmdline.cxx
+++ b/libbuild2/b-cmdline.cxx
@@ -421,6 +421,18 @@ namespace build2
if (ops.match_only () && ops.load_only ())
fail << "both --match-only and --load-only specified";
+
+ if (!ops.dump_specified ())
+ {
+ // Note: let's allow specifying --dump-format without --dump in case
+ // it comes from a default options file or some such.
+
+ if (ops.dump_target_specified ())
+ fail << "--dump-target requires --dump";
+
+ if (ops.dump_scope_specified ())
+ fail << "--dump-scope requires --dump";
+ }
}
catch (const cli::exception& e)
{