From 07ab59a93f9447d5489743e8d7e19b6adb5ebbf1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 9 Jul 2021 20:55:15 +0300 Subject: Add support for configuration type and bdep-config-link sub-command --- bdep/new.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'bdep/new.cxx') diff --git a/bdep/new.cxx b/bdep/new.cxx index b512497..5998630 100644 --- a/bdep/new.cxx +++ b/bdep/new.cxx @@ -242,7 +242,12 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args) // Validate options. // bool ca (o.config_add_specified ()); - bool cc (o.config_create_specified ()); + + // Type of configuration being created, if --config-create is specified. + // + optional cc (o.config_create_specified () + ? o.config_type () + : optional ()); if (o.subdirectory ()) fail << "--subdirectory was renamed to --source"; @@ -271,6 +276,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) + fail << "--config-type specified without --config-create"; + if (o.existing () && !cc) fail << "--existing|-e specified without --config-create"; @@ -3159,7 +3167,7 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args) ca ? o.config_add () : o.config_create (), cfg_args, ca, - cc)}; + move (cc))}; cmd_init (o, prj, db, cfgs, pkgs, strings () /* pkg_args */); } -- cgit v1.1