#which #unix #command #which-rs

which

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

13 stable releases (4 major)

Uses old Rust 2015

4.0.2 Aug 4, 2020
4.0.1 Jun 22, 2020
4.0.0 May 30, 2020
3.1.1 Mar 7, 2020
0.1.0 Oct 6, 2015

#3 in Operating systems

Download history 76611/week @ 2020-06-04 75514/week @ 2020-06-11 78702/week @ 2020-06-18 77889/week @ 2020-06-25 74733/week @ 2020-07-02 78211/week @ 2020-07-09 74527/week @ 2020-07-16 83434/week @ 2020-07-23 99892/week @ 2020-07-30 94025/week @ 2020-08-06 101330/week @ 2020-08-13 102965/week @ 2020-08-20 99105/week @ 2020-08-27 95260/week @ 2020-09-03 106465/week @ 2020-09-10 95686/week @ 2020-09-17

392,241 downloads per month
Used in 869 crates (91 directly)

MIT license

17KB
382 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

~0.4–0.9MB
~22K SLoC