aboutsummaryrefslogtreecommitdiff
path: root/bdep/new.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-07-09 20:55:15 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-07-20 17:08:09 +0300
commit07ab59a93f9447d5489743e8d7e19b6adb5ebbf1 (patch)
treeaa202b26e7ac2b3b6477855e250ab0464301fd2d /bdep/new.cxx
parent8da242097fcaec5f3676f8d2296b639879825ddd (diff)
Add support for configuration type and bdep-config-link sub-command
Diffstat (limited to 'bdep/new.cxx')
-rw-r--r--bdep/new.cxx12
1 files changed, 10 insertions, 2 deletions
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<string> cc (o.config_create_specified ()
+ ? o.config_type ()
+ : optional<string> ());
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 */);
}