aboutsummaryrefslogtreecommitdiff
path: root/bdep/config.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-06-15 23:34:56 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-06-17 18:45:28 +0300
commit064b22135afaf701f7f689ef75136298b9a0d278 (patch)
tree0f09134db6c125eb33e848c79fadcd893b7b25d6 /bdep/config.cxx
parentd2cc9eb93efbb34f5c88d672e04b126b0c422bb3 (diff)
Allow specifying pkg-args in bdep-init -A and -C forms
Diffstat (limited to 'bdep/config.cxx')
-rw-r--r--bdep/config.cxx27
1 files changed, 12 insertions, 15 deletions
diff --git a/bdep/config.cxx b/bdep/config.cxx
index 7c9b45d..da7f5f4 100644
--- a/bdep/config.cxx
+++ b/bdep/config.cxx
@@ -264,7 +264,7 @@ namespace bdep
const package_locations& pkgs,
database& db,
dir_path path,
- cli::scanner& cfg_args,
+ const strings& args,
optional<string> name,
optional<uint64_t> id)
{
@@ -279,19 +279,13 @@ namespace bdep
// Call bpkg to create the configuration.
//
- {
- strings args;
- while (cfg_args.more ())
- args.push_back (cfg_args.next ());
-
- run_bpkg (2,
- co,
- "create",
- "-d", path,
- (ao.existing () ? "--existing" : nullptr),
- (ao.wipe () ? "--wipe" : nullptr),
- args);
- }
+ run_bpkg (2,
+ co,
+ "create",
+ "-d", path,
+ (ao.existing () ? "--existing" : nullptr),
+ (ao.wipe () ? "--wipe" : nullptr),
+ args);
return cmd_config_add (ao,
prj,
@@ -386,13 +380,16 @@ namespace bdep
dir_path prj (find_project (o));
database db (open (prj, trace));
+ strings cfg_args;
+ for (; args.more (); cfg_args.push_back (args.next ())) ;
+
cmd_config_create (o,
o,
prj,
load_packages (prj, true /* allow_empty */),
db,
move (path),
- args,
+ cfg_args,
move (name),
move (id));
return 0;