Skip to main content

systemd_argument

Function systemd_argument 

Source
pub fn systemd_argument(value: &str) -> Result<String>
Expand description

Quote a value as one argument in a systemd unit directive.

systemd splits a command line on whitespace unless the word is quoted, and inside a double-quoted word it honours C-style backslash escapes — so both \ and " must be escaped. Specifier expansion (%h, %i, …) happens regardless of quoting, so % is doubled to keep it literal.