aboutsummaryrefslogtreecommitdiff
path: root/build2/utility.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/utility.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/utility.cxx')
-rw-r--r--build2/utility.cxx8
1 files changed, 6 insertions, 2 deletions
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<string> nullopt_string;
+ const optional<path> nullopt_path;
+ const optional<dir_path> nullopt_dir_path;
+
void
append_options (cstrings& args, const lookup& l, const char* e)
{