Skip to main content

shell_escape

Function shell_escape 

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

POSIX single-quote shell escape.

Wraps s in single quotes and replaces any embedded ' with '\''. Always produces a quoted result — the always-wrap strategy is the safest default: it is correct for all strings including empty ones and avoids “safe-char set” disputes between callers.

Mirrors shellEscape from packages/core/src/utils.ts.