From 4564a26c0b88d684c12c396d7ef5b0e66f686964 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 13 Oct 2021 20:05:27 +0300 Subject: Add --cwd|-t option to env pseudo-builtin --- libbuild2/script/script.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libbuild2/script/script.cxx') diff --git a/libbuild2/script/script.cxx b/libbuild2/script/script.cxx index 298d71f..9e6eeed 100644 --- a/libbuild2/script/script.cxx +++ b/libbuild2/script/script.cxx @@ -411,7 +411,7 @@ namespace build2 { // Print the env builtin if any of its options/arguments are present. // - if (!c.variables.empty () || c.timeout) + if (c.timeout || c.cwd || !c.variables.empty ()) { o << "env"; @@ -421,6 +421,14 @@ namespace build2 o << " -t " << chrono::duration_cast (*c.timeout).count (); + // CWD. + // + if (c.cwd) + { + o << " -c "; + print_path (*c.cwd); + } + // Variable unsets/sets. // auto b (c.variables.begin ()), i (b), e (c.variables.end ()); -- cgit v1.1