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

Function parse_gpu_request

crates/openshell-cli/src/main.rs:128–141  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

126}
127
128fn parse_gpu_request(value: &str) -> std::result::Result<GpuCliRequest, String> {
129 if value.is_empty() {
130 return Ok(GpuCliRequest::DriverDefault);
131 }
132
133 let count = value
134 .parse::<u32>()
135 .map_err(|_| "GPU count must be a positive integer".to_string())?;
136 if count == 0 {
137 return Err("GPU count must be greater than 0".to_string());
138 }
139
140 Ok(GpuCliRequest::Count(count))
141}
142
143fn resolve_gateway_name(gateway_flag: &Option<String>) -> Option<String> {
144 gateway_flag

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected