Print sandbox policy as YAML with dimmed keys.
(policy: &SandboxPolicy)
| 3321 | |
| 3322 | /// Print sandbox policy as YAML with dimmed keys. |
| 3323 | fn 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)] |
no test coverage detected