Spawn the platform's default opener for a URL, detached.
(target: &str)
| 179 | |
| 180 | /// Spawn the platform's default opener for a URL, detached. |
| 181 | fn open_in_browser(target: &str) -> std::io::Result<()> { |
| 182 | #[cfg(target_os = "macos")] |
| 183 | let mut cmd = { |
| 184 | let mut c = ProcessCommand::new("open"); |
| 185 | c.arg(target); |
| 186 | c |
| 187 | }; |
| 188 | #[cfg(target_os = "windows")] |
| 189 | let mut cmd = { |
| 190 | let mut c = ProcessCommand::new("cmd"); |
| 191 | c.args(["/C", "start", "", target]); |
| 192 | c |
| 193 | }; |
| 194 | #[cfg(all(unix, not(target_os = "macos")))] |
| 195 | let mut cmd = { |
| 196 | let mut c = ProcessCommand::new("xdg-open"); |
| 197 | c.arg(target); |
| 198 | c |
| 199 | }; |
| 200 | |
| 201 | cmd.stdout(Stdio::null()).stderr(Stdio::null()).spawn()?; |
| 202 | Ok(()) |
| 203 | } |
| 204 | |
| 205 | /// Build the canonical triage report for `<feature>` relative to `--into`. |
| 206 | #[derive(Debug, Parser)] |
no outgoing calls
no test coverage detected