Go to file
openharmony_ci ca6fe5f03a
Some checks failed
Main workflow / Rustfmt [Formatter] (push) Has been cancelled
Main workflow / Clippy [Linter] (macos-latest) (push) Has been cancelled
Main workflow / Clippy [Linter] (ubuntu-latest) (push) Has been cancelled
Main workflow / Clippy [Linter] (windows-latest) (push) Has been cancelled
Main workflow / Compile (push) Has been cancelled
Main workflow / Test Suite (macos-latest, nightly) (push) Has been cancelled
Main workflow / Test Suite (macos-latest, stable) (push) Has been cancelled
Main workflow / Test Suite (ubuntu-latest, nightly) (push) Has been cancelled
Main workflow / Test Suite (ubuntu-latest, stable) (push) Has been cancelled
Main workflow / Test Suite (windows-latest, nightly) (push) Has been cancelled
Main workflow / Test Suite (windows-latest, stable) (push) Has been cancelled
!4 修改软件名
Merge pull request !4 from archane/master
2024-11-05 10:45:50 +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 update Name in README.OpenSource 2024-10-31 16:50:12 +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.