From 353438a94953bf4d093af0d84decd5ec7529ed34 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 20 Jun 2018 09:51:56 +0200 Subject: Add $process.run() and $process.run_regex() functions $process.run([ ...]) Return trimmed stdout. $process.run_regex([ ...], [, ]) Return stdout lines matched and optionally processed with regex. Each line of stdout (including the customary trailing blank) is matched (as a whole) against and, if successful, returned, optionally processed with , as an element of a list. --- build2/utility.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'build2/utility.cxx') diff --git a/build2/utility.cxx b/build2/utility.cxx index cbae507..07cf88e 100644 --- a/build2/utility.cxx +++ b/build2/utility.cxx @@ -254,10 +254,14 @@ namespace build2 fail (loc) << "unable to execute " << args[0] << ": " << e << endf; } - const string empty_string; - const path empty_path; + const string empty_string; + const path empty_path; const dir_path empty_dir_path; + const optional nullopt_string; + const optional nullopt_path; + const optional nullopt_dir_path; + void append_options (cstrings& args, const lookup& l, const char* e) { -- cgit v1.1