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

Function print_sandbox_policy

crates/openshell-cli/src/run.rs:3323–3336  ·  view source on GitHub ↗

Print sandbox policy as YAML with dimmed keys.

(policy: &SandboxPolicy)

Source from the content-addressed store, hash-verified

3321
3322/// Print sandbox policy as YAML with dimmed keys.
3323fn print_sandbox_policy(policy: &SandboxPolicy) {
3324 println!("{}", "Policy:".cyan().bold());
3325 println!();
3326 if let Ok(yaml_str) = openshell_policy::serialize_sandbox_policy(policy) {
3327 // Indent the YAML output and skip the initial "---" line
3328 for line in yaml_str.lines() {
3329 if line == "---" {
3330 continue;
3331 }
3332 print!(" ");
3333 print_yaml_line(line);
3334 }
3335 }
3336}
3337
3338/// List sandboxes.
3339#[allow(clippy::too_many_arguments)]

Callers 2

sandbox_getFunction · 0.85
sandbox_policy_updateFunction · 0.85

Calls 2

serialize_sandbox_policyFunction · 0.85
print_yaml_lineFunction · 0.85

Tested by

no test coverage detected