Documentation
¶
Overview ¶
Package desktopentry escapes and reads the string values of a freedesktop Desktop Entry file, chiefly the Exec key.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exec ¶
Exec builds an Exec= value from argv. argv[0] is always double-quoted; any other argument is quoted when it is empty (written `""`) or holds a reserved character: space, tab, CR, LF, `"`, `'`, `\`, `>`, `<`, `~`, `|`, `&`, `;`, `$`, `*`, `?`, `#`, `(`, `)` or "`". Inside quotes `"`, "`", `$` and `\` are backslash-escaped. Every `%` becomes `%%`. Then the whole line gets the string escapes, because the spec undoes those before the Exec quoting: `\` doubled, a tab as `\t`, CR as `\r` and LF as `\n`. Field codes (%u, %f) are appended by the caller after the call.
func SplitExec ¶
SplitExec is Exec's reader, for any program's entry: it undoes the string escapes, then the quoting, then `%%`, and returns the arguments. Every other field code (%u, %f, ...) is left in place for the caller to expand. Because `%%` is undone, an argument written `%%u` and a field code `%u` both read back as `%u`.
Types ¶
This section is empty.