From 4d79c195d440f807e84235a8184b04a9f633cf94 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Aug 2021 09:09:22 +0200 Subject: Allow specifying config type with --type in bdep-config-create, bdep-init --- bdep/new.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bdep/new.cxx') diff --git a/bdep/new.cxx b/bdep/new.cxx index 915e042..a8f3af7 100644 --- a/bdep/new.cxx +++ b/bdep/new.cxx @@ -245,8 +245,12 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args) // Type of configuration being created, if --config-create is specified. // + // Note that our --type|-t overrides --type|--config-type from + // configuration_add_options. + // + configuration_add_options& cao (o); optional cc (o.config_create_specified () - ? o.config_type () + ? cao.type () : optional ()); if (o.subdirectory ()) @@ -276,7 +280,9 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args) if (!ca && !cc) fail << n << " specified without --config-(add|create)"; - if (o.config_type_specified () && !cc) + // Note: no --type|... (see above). + // + if (cao.type_specified () && !cc) fail << "--config-type specified without --config-create"; if (o.existing () && !cc) -- cgit v1.1