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.

Members

Functions

opOpAssign
void opOpAssign(string item)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(Path item)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(Range items)
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(string item)
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(Path item)
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(Range items)
Undocumented in source. Be warned that the author may not have intended to support it.
reserve
void reserve(size_t newCapacity)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

capacity
size_t capacity [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
data
string data [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
length
size_t length [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

Args args;
args ~= Path(`some/big path/here/foobar`);
args ~= "-A";
args ~= "--bcd";
args ~= "Hello World";
args ~= Path("file.ext");

// On windows:
assert(args.data == `"some\big path\here\foobar" -A --bcd "Hello World" file.ext`);
// On linux:
assert(args.data == `'some/big path/here/foobar' -A --bcd 'Hello World' file.ext`);

Meta