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.hxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'build2/utility.hxx') diff --git a/build2/utility.hxx b/build2/utility.hxx index 81a5d87..6e76f05 100644 --- a/build2/utility.hxx +++ b/build2/utility.hxx @@ -154,7 +154,7 @@ namespace build2 process_path run_search (const path&, - bool init, + bool init = false, const dir_path& fallback = dir_path (), const location& = location ()); @@ -388,12 +388,16 @@ namespace build2 verbosity, pp, args, forward (f), error, ignore_exit, checksum); } - // Empty string and path. + // Empty/nullopt string and path. // - extern const string empty_string; - extern const path empty_path; + extern const string empty_string; + extern const path empty_path; extern const dir_path empty_dir_path; + extern const optional nullopt_string; + extern const optional nullopt_path; + extern const optional nullopt_dir_path; + // Hash a path potentially without the specific directory prefix. // // If prefix is not empty and is a super-path of the path to hash, then only -- cgit v1.1