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-builtin.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'build2/functions-builtin.cxx') diff --git a/build2/functions-builtin.cxx b/build2/functions-builtin.cxx index 45ad7df..8db38c2 100644 --- a/build2/functions-builtin.cxx +++ b/build2/functions-builtin.cxx @@ -11,7 +11,7 @@ namespace build2 // otherwise. // static inline value - getvar (const string& name) + getenvvar (const string& name) { optional v (getenv (name)); @@ -19,7 +19,7 @@ namespace build2 return value (); names r; - r.emplace_back (to_name (*v)); + r.emplace_back (to_name (move (*v))); return value (move (r)); } @@ -45,12 +45,12 @@ namespace build2 // f["getenv"] = [](string name) { - return getvar (name); + return getenvvar (name); }; f["getenv"] = [](names name) { - return getvar (convert (move (name))); + return getenvvar (convert (move (name))); }; } } -- cgit v1.1