The new std.process is ready for review

Lars T. Kyllingstad public at kyllingen.net
Sun Mar 31 06:57:12 PDT 2013


On Sunday, 31 March 2013 at 13:14:52 UTC, Johannes Pfau wrote:
>
> Reposted from github:
> I think it would be nice if the high level functions would also 
> allow
> using custom environment variables. So the execute and 
> executeShell
> functions should have overloads which accept a string[string] 
> with
> environment variables (and probably accept a Config as well).
>
> The execute and executeShell functions would be trivial to 
> implement
> though if pipeProcess / pipeShell had an overload with 
> environment
> and Config parameters. So it's probably more important that
> pipeProcess / pipeShell get these overloads.

Implementation-wise, it is a simple task to add this 
functionality to both pipeProcess/pipeShell and 
execute/executeShell.  It comes at the cost of more complex 
function signatures for high-level functions which have, so far, 
intentionally been kept rather simple:

ProcessPipes pipeProcess(
     string[] args,
     Redirect redirectFlags = Redirect.all,
     string[string] env = null,
     Config config = Config.none);

Tuple execute(
     string[] args,
     string[string] env = null,
     Config config = Config.none);

But maybe that's not so bad?

Lars


More information about the Digitalmars-d mailing list