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/functions-regex.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'build2/functions-regex.cxx') diff --git a/build2/functions-regex.cxx b/build2/functions-regex.cxx index 76fcce9..9c428fd 100644 --- a/build2/functions-regex.cxx +++ b/build2/functions-regex.cxx @@ -29,7 +29,9 @@ namespace build2 // Parse a regular expression. Throw invalid_argument if it is not valid. // - static regex + // Note: also used in functions-process.cxx (thus not static). + // + regex parse_regex (const string& s, regex::flag_type f) { try -- cgit v1.1