open 5.3.3

Open a path or URL using the program configured on the system
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::{ffi::OsStr, process::Command};

pub fn commands<T: AsRef<OsStr>>(path: T) -> Vec<Command> {
    let mut cmd = Command::new("uiopen");
    cmd.arg("--url").arg(path.as_ref());
    vec![cmd]
}

pub fn with_command<T: AsRef<OsStr>>(path: T, app: impl Into<String>) -> Command {
    let mut cmd = Command::new("uiopen");
    cmd.arg("--url")
        .arg(path.as_ref())
        .arg("--bundleid")
        .arg(app.into());
    cmd
}