#path-environment #env-var #executable #command #variables #find

path_lookup

Find all executables in the PATH environment variable

5 releases

0.1.5 Jan 29, 2024
0.1.4 Jan 29, 2024

#8 in #path-environment


Used in enwiro

MIT license

5KB
57 lines

path_lookup-rs

Find all available executable commands in $PATH in Rust.

Install

Add path_lookup to your Cargo.toml:

cargo add path_lookup

Usage

iterate_executables() returns an Iterator<Item = String>:

for command in iterate_executables() {
    // ... etc ...
}

get_executables() returns a HashSet<String>:

let all_commands: HashSet<String> = get_executables();

Dependencies

~175KB