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.hxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'bdep/utility.hxx') diff --git a/bdep/utility.hxx b/bdep/utility.hxx index dc9e589..da491c3 100644 --- a/bdep/utility.hxx +++ b/bdep/utility.hxx @@ -184,6 +184,25 @@ namespace bdep template bool parse_command (cli::scanner& scan, C&); + + // Scan and return/append arguments preserving grouping. + // + void + scan_argument (strings&, cli::group_scanner&); + + inline void + scan_arguments (strings& r, cli::group_scanner& s) + { + for (; s.more (); scan_argument (r, s)) ; + } + + inline strings + scan_arguments (cli::group_scanner& s) + { + strings r; + scan_arguments (r, s); + return r; + } } #include -- cgit v1.1