Build Status

which

A Rust equivalent of Unix command "which". Locate installed executable in cross platforms.

Support platforms

Examples

1) To find which rustc executable binary is using.

``` rust
use which::which;

let result = which("rustc").unwrap();
assert_eq!(result, PathBuf::from("/usr/bin/rustc"));
```
  1. After enabling the regex feature, find all cargo subcommand executables on the path:

    ``` rust use which::which_re;

    whichre(Regex::new("^cargo-.*").unwrap()).unwrap() .foreach(|pth| println!("{}", pth.tostringlossy())); ```

MSRV

This crate currently has an MSRV of Rust 1.63. Increasing the MSRV is considered a breaking change and thus requires a major version bump.

Documentation

The documentation is available online.