fwd/vendor/open
John Doty 9c435dc440 Vendor dependencies
Let's see how I like this workflow.
2022-12-19 08:38:22 -08:00
..
src Vendor dependencies 2022-12-19 08:38:22 -08:00
.cargo-checksum.json Vendor dependencies 2022-12-19 08:38:22 -08:00
Cargo.lock Vendor dependencies 2022-12-19 08:38:22 -08:00
Cargo.toml Vendor dependencies 2022-12-19 08:38:22 -08:00
changelog.md Vendor dependencies 2022-12-19 08:38:22 -08:00
LICENSE.md Vendor dependencies 2022-12-19 08:38:22 -08:00
README.md Vendor dependencies 2022-12-19 08:38:22 -08:00

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:

# macOS
$ 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 = "3"

…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.