diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-08-20 09:09:22 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-08-20 09:09:22 +0200 |
commit | 4d79c195d440f807e84235a8184b04a9f633cf94 (patch) | |
tree | 3c0f4a2ba118a6ffc588f0852a4721e556bc52e2 /bdep/new.cxx | |
parent | ba8e0b9f9866b47bc61b49323e4293ba90826e80 (diff) |
Allow specifying config type with --type in bdep-config-create, bdep-init
Diffstat (limited to 'bdep/new.cxx')
-rw-r--r-- | bdep/new.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
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<string> cc (o.config_create_specified () - ? o.config_type () + ? cao.type () : optional<string> ()); 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) |