From 4681fdb1160939bcd32c208eae4de474d90b44c1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Aug 2020 12:12:45 +0200 Subject: Add few more run() overloads --- libbuild2/utility.hxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'libbuild2') diff --git a/libbuild2/utility.hxx b/libbuild2/utility.hxx index b747667..4560a73 100644 --- a/libbuild2/utility.hxx +++ b/libbuild2/utility.hxx @@ -331,9 +331,24 @@ namespace build2 } inline void + run (const process_env& pe, // Implicit-constructible from process_path. + const char* args[]) + { + process pr (run_start (pe, args, 0, 1, true)); + run_finish (args, pr); + } + + inline void + run (const process_env& pe, // Implicit-constructible from process_path. + cstrings& args) + { + run (pe, args.data ()); + } + + inline void run (const process_path& p, const char* args[], - const dir_path& cwd = dir_path (), + const dir_path& cwd, const char* const* env = nullptr) { process pr (run_start (process_env (p, env), args, 0, 1, true, cwd)); @@ -343,7 +358,7 @@ namespace build2 inline void run (const process_path& p, cstrings& args, - const dir_path& cwd = dir_path (), + const dir_path& cwd, const char* const* env = nullptr) { run (p, args.data (), cwd, env); -- cgit v1.1