From 064b22135afaf701f7f689ef75136298b9a0d278 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 15 Jun 2019 23:34:56 +0300 Subject: Allow specifying pkg-args in bdep-init -A and -C forms --- bdep/config.cxx | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'bdep/config.cxx') 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 name, optional 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; -- cgit v1.1