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

Function host_line_matches

crates/openshell-cli/src/ssh.rs:1523–1531  ·  view source on GitHub ↗
(line: &str, alias: &str)

Source from the content-addressed store, hash-verified

1521}
1522
1523fn host_line_matches(line: &str, alias: &str) -> bool {
1524 let trimmed = line.trim_start();
1525 if !trimmed.starts_with("Host ") {
1526 return false;
1527 }
1528 trimmed["Host ".len()..]
1529 .split_whitespace()
1530 .any(|token| token == alias)
1531}
1532
1533fn upsert_host_block(contents: &str, alias: &str, block: &str) -> String {
1534 let lines: Vec<&str> = contents.lines().collect();

Callers 1

upsert_host_blockFunction · 0.85

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected