aboutsummaryrefslogtreecommitdiff
path: root/build2/functions-regex.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-06-20 09:51:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-06-20 09:51:56 +0200
commit353438a94953bf4d093af0d84decd5ec7529ed34 (patch)
tree4c4e376ff8d831e85954a9b74f2157ad4b06351a /build2/functions-regex.cxx
parentc6b3f6659eda9b0b255ddc2d24accdd998b5938d (diff)
Add $process.run() and $process.run_regex() functions
$process.run(<prog>[ <args>...]) Return trimmed stdout. $process.run_regex(<prog>[ <args>...], <pat> [, <fmt>]) Return stdout lines matched and optionally processed with regex. Each line of stdout (including the customary trailing blank) is matched (as a whole) against <pat> and, if successful, returned, optionally processed with <fmt>, as an element of a list.
Diffstat (limited to 'build2/functions-regex.cxx')
-rw-r--r--build2/functions-regex.cxx4
1 files changed, 3 insertions, 1 deletions
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