tree: b5354b7292810b855342eac0f74cb0aead937e28 [path history] [tgz]
  1. src/
  2. .cargo-checksum.json
  3. Cargo.lock
  4. Cargo.toml
  5. changelog.md
  6. LICENSE.md
  7. README.md
android/vendor/open-3.0.2/README.md

Crates.io cross-platform-testing

Use this library to open a path or URL using the program configured on the system. It is equivalent to running one of the following:

# OSX
$ open <path-or-url>
# Windows
$ start <path-or-url>
# Linux
$ xdg-open <path-or-url> || gio open <path-or-url> || gnome-open <path-or-url> || kde-open <path-or-url> || wslview <path-or-url>

Usage

Add this to your Cargo.toml

[dependencies]
open = "1"

…and open something using…

open::that("https://rust-lang.org");

…or, open something with an application of your choice

open::with("https://rust-lang.org", "firefox");

Follow this link for the massive API docs.

Credits

The implementation is based on the respective functionality of cargo, but was improved to allow some error handling.