lf 0.2.0

Locate a file in file explorer
Documentation
1
2
3
4
5
6
7
8
9
10
11
use std::process::{Command, Output};

pub fn open_folder_and_select_items(paths: &[&str]) -> Output {
    if paths.len() > 1 {
        println!("windows supports to select only 1 file.")
    }
    let mut cmd = Command::new("explorer.exe");
    let arg = format!("/select,{}", paths[0]);
    cmd.arg(arg);
    cmd.output().expect("failed to run explorer.exe")
}