expandExecArgs

Expand Exec arguments (usually returned by parseExecString) replacing field codes with given values, making the array suitable for passing to spawnProcess. Deprecated field codes are ignored. Note: Returned array may be empty and should be checked before passing to spawnProcess.

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

Parameters

execArgs string[]

array of unquoted and unescaped arguments.

urls string[]

array of urls or file names that inserted in the place of %f, %F, %u or %U field codes. For %f and %u only the first element of array is used.

iconName string

icon name used to substitute %i field code by --icon iconName.

name string

name of application used that inserted in the place of %c field code.

fileName string

name of desktop file that inserted in the place of %k field code.

Throws

DesktopExecException if command line contains unknown field code.

Examples

assert(expandExecArgs(["program name", "%%f", "%f", "%i"], ["one", "two"], "folder") == ["program name", "%f", "one", "--icon", "folder"]);
assertThrown!DesktopExecException(expandExecArgs(["program name", "%y"]));

See Also

parseExecString

Meta