which-rs 0.1.1

Check for and locate installed executables from Rust.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 4.57 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 756.65 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • Documentation
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • realityone

which-rs

Check for and locate installed executables from Rust.

Just demostrate how which command works.

Using as a library

Put this crate in your Cargo.toml.

[dependencies]
which-rs = "*"

Usage

extern crate which;

use std::path::{Path, PathBuf};
use std::collections::HashMap;

fn main() {
    let ref file = ["python",];
    let ref paths = [Path::new("/usr/local/bin"), Path::new("/usr/bin")];
    let mut find_path = HashMap::new();

    let all_find = which::which(file, paths, true, Some(&mut find_path));
    println!("All binary is found: {:?}", all_find);
    println!("Located at {:?}", find_path);
}

License

which-rs is licensed under the MIT License - see the LICENSE file for details