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