Skip to main content

shell_quote

Function shell_quote 

Source
pub fn shell_quote(s: &str) -> String
Expand description

Wrap a string in single-quotes if it contains any shell-special characters.

Uses an allowlist of safe characters — anything not in the list triggers quoting. Single-quoting avoids variable expansion and is safer than double-quoting.