• Home
Name Date Size #Lines LOC

..--

.github/workflows/03-May-2024-9475

src/03-May-2024-1,013668

tests/03-May-2024-405330

.cargo_vcs_info.jsonD03-May-202494 66

.gitignoreD03-May-202427 43

Android.bpD03-May-2024972 4137

Cargo.tomlD03-May-20241.2 KiB5143

Cargo.toml.origD03-May-2024676 2722

LICENSED03-May-20241 KiB2016

LICENSE.txtD03-May-20241 KiB2016

METADATAD03-May-2024658 2422

MODULE_LICENSE_MITD03-May-20240

OWNERSD03-May-202440 21

README.mdD03-May-2024860 3622

TEST_MAPPINGD03-May-2024287 1514

cargo2android.jsonD03-May-202453 55

README.md

1[![Build Status](https://github.com/harryfei/which-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/harryfei/which-rs/actions/workflows/rust.yml)
2
3# which
4
5A Rust equivalent of Unix command "which". Locate installed executable in cross platforms.
6
7## Support platforms
8
9* Linux
10* Windows
11* macOS
12
13## Examples
14
151) To find which rustc executable binary is using.
16
17    ``` rust
18    use which::which;
19
20    let result = which("rustc").unwrap();
21    assert_eq!(result, PathBuf::from("/usr/bin/rustc"));
22    ```
23
242. After enabling the `regex` feature, find all cargo subcommand executables on the path:
25
26    ``` rust
27    use which::which_re;
28
29    which_re(Regex::new("^cargo-.*").unwrap()).unwrap()
30        .for_each(|pth| println!("{}", pth.to_string_lossy()));
31    ```
32
33## Documentation
34
35The documentation is [available online](https://docs.rs/which/).
36