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

Function detect_provider_from_command

crates/openshell-providers/src/lib.rs:208–215  ·  view source on GitHub ↗
(command: &[String])

Source from the content-addressed store, hash-verified

206
207#[must_use]
208pub fn detect_provider_from_command(command: &[String]) -> Option<&'static str> {
209 let first = command.first()?;
210 let basename = Path::new(first)
211 .file_name()
212 .and_then(|name| name.to_str())
213 .unwrap_or(first);
214 normalize_provider_type(basename)
215}
216
217#[cfg(test)]
218mod tests {

Callers 1

inferred_provider_typeFunction · 0.85

Calls 1

normalize_provider_typeFunction · 0.85

Tested by

no test coverage detected