From e3133aa9628858bcfe414f95731831b5962358c7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 May 2018 06:43:44 +0200 Subject: Support passing additional arguments to pkg-build in sync, init, new --- bdep/utility.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'bdep/utility.cxx') diff --git a/bdep/utility.cxx b/bdep/utility.cxx index 15fb599..98b6279 100644 --- a/bdep/utility.cxx +++ b/bdep/utility.cxx @@ -133,4 +133,23 @@ namespace bdep ? co.build ().string ().c_str () : "b" BDEP_EXE_SUFFIX; } + + void + scan_argument (strings& r, cli::group_scanner& s) + { + // Copy over the argument including the group. + // + using scanner = cli::scanner; + using group_scanner = cli::group_scanner; + + r.push_back (group_scanner::escape (s.next ())); + + scanner& gs (s.group ()); + if (gs.more ()) + { + r.push_back ("+{"); + for (; gs.more (); r.push_back (group_scanner::escape (gs.next ()))) ; + r.push_back ("}"); + } + } } -- cgit v1.1