Skip to content
Permalink
Browse files

rename previously linux-only function to include BSDs

  • Loading branch information...
hrkfdn authored and amodm committed Mar 31, 2019
1 parent 014af16 commit 28ed7b97d8d5ab703052968995a3b34be6a444b8
Showing with 3 additions and 3 deletions.
  1. +1 −1 README.md
  2. +2 −2 src/lib.rs
@@ -28,7 +28,7 @@ Currently state of platform support is:

* macos => default, as well as browsers listed under [Browser](enum.Browser.html)
* windows => default browser only
* linux => default browser only (uses $BROWSER env var, failing back to xdg-open, gvfs-open, gnome-open, whichever works first)
* linux/*bsd => default browser only (uses $BROWSER env var, failing back to xdg-open, gvfs-open, gnome-open, whichever works first)
* android => not supported right now
* ios => not supported right now
@@ -250,7 +250,7 @@ fn open_browser_internal(browser: Browser, url: &str) -> Result<Output> {
#[inline]
fn open_browser_internal(browser: Browser, url: &str) -> Result<Output> {
match browser {
Browser::Default => open_on_linux_using_browser_env(url)
Browser::Default => open_on_unix_using_browser_env(url)
.or_else(|_| -> Result<Output> { Command::new("xdg-open").arg(url).output() })
.or_else(|_| -> Result<Output> { Command::new("gvfs-open").arg(url).output() })
.or_else(|_| -> Result<Output> { Command::new("gnome-open").arg(url).output() }),
@@ -266,7 +266,7 @@ fn open_browser_internal(browser: Browser, url: &str) -> Result<Output> {
target_os = "netbsd",
target_os = "openbsd"
))]
fn open_on_linux_using_browser_env(url: &str) -> Result<Output> {
fn open_on_unix_using_browser_env(url: &str) -> Result<Output> {
let browsers = ::std::env::var("BROWSER")
.map_err(|_| -> Error { Error::new(ErrorKind::NotFound, "BROWSER env not set") })?;
for browser in browsers.split(':') {

0 comments on commit 28ed7b9

Please sign in to comment.
You can’t perform that action at this time.