1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Locates installed executable inside directories specified in the *PATH*
//! environment variable.
//!
//! The goals of this implementations are:
//!
//! * No dependencies except the standard library.
//! * No unsafe code, no syscalls, no calls to libc.
//! * Compatibility with [Miri](https://github.com/rust-lang/miri).
//!
//! # Example
//!
//! **whereismybin** can be used as a library. Example:
//!
//! ```rust,no_run
//! use std::process::Command;
//!
//! use whereismybin::whereismybin;
//!
//! let my_tool = whereismybin("my-tool").expect("Could not find my-tool");
//! let output = Command::new(my_tool)
//! .arg("--some-arg")
//! .output()
//! .expect("Failed to execute process");
//! let content = output.stdout;
//! ```
//!
//! # Why not which-rs?
//!
//! The [which-rs](https://crates.io/crates/which) crate is great, but
//! unfortunately it doesn't run on [Miri](https://github.com/rust-lang/miri)
//! and depends on [libc](https://crates.io/crates/libc) crate. **whereismybin**
//! aims to provide more lightweight alternative.
use ;