Struct 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.
Properties
Name | Type | Description |
---|---|---|
capacity
[get]
|
ulong |
|
data
[get]
|
string |
|
length
[get]
|
ulong |
Methods
Name | Description |
---|---|
opOpAssign
|
|
opOpAssign
|
|
opOpAssign
|
|
put
|
|
put
|
|
put
|
|
reserve
|
Example
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`);
Authors
Nick Sabalausky
Copyright
Copyright (C) 2014-2015 Nick Sabalausky
License
zlib/libpng