MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / shell_escape

Function shell_escape

e2e/rust/src/harness/binary.rs:52–61  ·  view source on GitHub ↗
(arg: &str)

Source from the content-addressed store, hash-verified

50}
51
52fn shell_escape(arg: &str) -> String {
53 if arg
54 .chars()
55 .all(|c| c.is_ascii_alphanumeric() || "-_./:@".contains(c))
56 {
57 return arg.to_string();
58 }
59
60 format!("'{}'", arg.replace('\'', "'\\''"))
61}
62
63/// Create a [`tokio::process::Command`] that runs `openshell` under a PTY.
64pub fn openshell_tty_cmd(args: &[&str]) -> tokio::process::Command {

Callers 1

openshell_tty_cmdFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected