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

Function ssh_config_includes_path

crates/openshell-cli/src/ssh.rs:1467–1479  ·  view source on GitHub ↗
(contents: &str, path: &Path)

Source from the content-addressed store, hash-verified

1465}
1466
1467fn ssh_config_includes_path(contents: &str, path: &Path) -> bool {
1468 let quoted = format!("\"{}\"", path.display());
1469 let plain = path.display().to_string();
1470 contents.lines().any(|line| {
1471 let trimmed = line.trim();
1472 if !trimmed.starts_with("Include ") {
1473 return false;
1474 }
1475 trimmed["Include ".len()..]
1476 .split_whitespace()
1477 .any(|token| token == quoted || token == plain)
1478 })
1479}
1480
1481fn ensure_openshell_include(main_config: &Path, managed_config: &Path) -> Result<()> {
1482 if let Some(parent) = main_config.parent() {

Callers 1

ensure_openshell_includeFunction · 0.85

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected