Go to file
openharmony_ci b3ba51a154
!3 修改Readme.Opensources
Merge pull request !3 from xxlight/dev_check
2023-05-09 06:06:14 +00:00
.github/workflows ci: test and run linter on macos 2022-01-24 21:16:38 +08:00
src Merge pull request #62 from Xaeroxe/global/config 2022-09-27 20:52:11 +08:00
tests Fix extension casing on windows 2022-08-29 23:10:08 -06:00
.gitignore feat(lib): allow searching with regular expressions 2021-07-25 13:12:49 -04:00
BUILD.gn Add GN Build Files and Custom Modifications 2023-04-12 17:27:21 +08:00
Cargo.toml bump version to 4.4.0 2023-01-20 17:11:35 +08:00
LICENSE.txt init commit 2015-10-06 19:24:01 +08:00
README.md Document which_re in readme 2021-11-30 22:31:44 +01:00
README.OpenSource check cxx and bindgen tests 2023-05-08 11:50:39 +08:00

Build Status

which

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

Support platforms

  • Linux
  • Windows
  • macOS

Examples

  1. To find which rustc executable binary is using.

    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:

    use which::which_re;
    
    which_re(Regex::new("^cargo-.*").unwrap()).unwrap()
        .for_each(|pth| println!("{}", pth.to_string_lossy()));
    

Documentation

The documentation is available online.