ichwh - an async implementation of GNU which

Crates.io Gitlab pipeline status

ichwh aims to be a fully-async clone of GNU which, compatible with the three major operating systems. The main job of which is to search for executables on the current PATH.

This crate is similar to the synchronous which crate. The main difference is that ichwh is asynchronous, and provides a which_all method.

Usage

In Cargo.toml:

toml ichwh = "*"

In your source files:

```rust use ichwh::which;

let pathtopython = which("python").await.unwrap(); asserteq!(pathtopython.tostr().unwrap(), "/usr/bin/python"); ```

Testing

Run tests with cargo test. The tests will create a set of temporary test folders. They are rooted at /tmp/ichwh-test-<num> (%TEMP%/... on windows), where <num> is the number of minutes since the unix epoch. If all tests pass, the folders will be cleaned up. Any failing tests will preserve their test folders for inspection and debugging.

Contributing

See CONTRIBUTING.md.