#which #unix #command #which-rs

build which

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

10 releases (stable)

2.0.0 Mar 30, 2018
1.0.5 Feb 17, 2018
1.0.3 Oct 4, 2017
1.0.2 Jun 14, 2017
0.1.0 Oct 6, 2015

#2 in Operating systems

Download history 1748/week @ 2018-05-27 2173/week @ 2018-06-03 2735/week @ 2018-06-10 2562/week @ 2018-06-17 3075/week @ 2018-06-24 2709/week @ 2018-07-01 4040/week @ 2018-07-08 3021/week @ 2018-07-15 3411/week @ 2018-07-22 3638/week @ 2018-07-29 3036/week @ 2018-08-05 3109/week @ 2018-08-12 3841/week @ 2018-08-19

6,600 downloads per month
Used in 377 crates (19 directly)

MIT license

22KB
536 lines

Travis Build Status Appveyor Build status

which

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

Support platforms

  • Linux
  • Windows
  • macOS

Example

To find which rustc exectable binary is using. Locate installed execuable in cross platforms.

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

~223KB