expandExecString

Unquote, unescape Exec string and expand field codes substituting them with appropriate values.

@trusted pure
string[]
expandExecString
(
string execString
,
in string[] urls = null
,
string iconName = null
,
string name = null
,
string fileName = null
)

Throws

DesktopExecException if string can't be unquoted, unquoted command line is empty or it has unknown field code.

Examples

assert(expandExecString(`"quoted program" %i -w %c -f %k %U %D %u %f %F`, ["one", "two"], "folder", "Программа", "/example.desktop") == ["quoted program", "--icon", "folder", "-w", "Программа", "-f", "/example.desktop", "one", "two", "one", "one", "one", "two"]);

assertThrown!DesktopExecException(expandExecString(`program %f %y`)); //%y is unknown field code.
assertThrown!DesktopExecException(expandExecString(``));

See Also

expandExecArgs, parseExecString

Meta