Args

Much like std.array.Appender!string, but specifically geared towards building a command string out of arguments. String and Path can both be appended. All elements added will automatically be escaped, and separated by spaces, as necessary.

struct Args {}

Examples

1 Args args;
2 args ~= Path(`some/big path/here/foobar`);
3 args ~= "-A";
4 args ~= "--bcd";
5 args ~= "Hello World";
6 args ~= Path("file.ext");
7 
8 // On windows:
9 assert(args.data == `"some\big path\here\foobar" -A --bcd "Hello World" file.ext`);
10 // On linux:
11 assert(args.data == `'some/big path/here/foobar' -A --bcd 'Hello World' file.ext`);

Meta