From f8a8b3f127712e93d9f408ef3a58f1342e3cd7d8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 15 Jan 2024 09:59:55 +0200 Subject: Make sure --dump-{scope,target} are specified with --dump --- libbuild2/b-cmdline.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libbuild2') 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) { -- cgit v1.1