| 126 | } |
| 127 | |
| 128 | fn 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 | |
| 143 | fn resolve_gateway_name(gateway_flag: &Option<String>) -> Option<String> { |
| 144 | gateway_flag |