#which #unix #command #which-rs

which

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

12 stable releases (4 major)

4.0.1 Jun 22, 2020
3.1.1 Mar 7, 2020
3.1.0 Nov 3, 2019
2.0.1 Nov 27, 2018
0.1.0 Oct 6, 2015

#4 in Operating systems

Download history 61691/week @ 2020-03-16 64738/week @ 2020-03-23 61092/week @ 2020-03-30 57871/week @ 2020-04-06 62496/week @ 2020-04-13 70037/week @ 2020-04-20 69958/week @ 2020-04-27 65761/week @ 2020-05-04 74534/week @ 2020-05-11 63359/week @ 2020-05-18 62589/week @ 2020-05-25 71694/week @ 2020-06-01 74958/week @ 2020-06-08 78929/week @ 2020-06-15 77949/week @ 2020-06-22 72278/week @ 2020-06-29

287,577 downloads per month
Used in 714 crates (75 directly)

MIT license

17KB
379 lines

Travis Build Status Appveyor Build status

which

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

Support platforms

  • Linux
  • Windows
  • macOS

Example

To find which rustc exectable binary is using.

use which::which;

let result = which::which("rustc").unwrap();
assert_eq!(result, PathBuf::from("/usr/bin/rustc"));

Documentation

The documentation is available online.


lib.rs:

which

A Rust equivalent of Unix command which(1).

Example:

To find which rustc executable binary is using:

use which::which;

let result = which::which("rustc").unwrap();
assert_eq!(result, PathBuf::from("/usr/bin/rustc"));

Dependencies

~400–760KB
~18K SLoC