Process.addArgs

Add arguments to the process.

This could be used if you do not know all the arguments for program to run at single point, and you need to add it conditionally.

struct Process
ref
addArgs
(
in string[] args...
)

Parameters

args string[]

array of arguments to run program with

Return Value

Type: auto ref

reference to this (process instance)

Examples

auto program = Process(y-program
    .withArgs("--some-option");

if (some condition)
    program.addArgs("--some-other-opt", "--verbose");

auto result = program
    .execute()
    .ensureStatus!MyException("My error message on failure");
writeln(result.output);

Meta