Function find_program_from_env

Source
pub fn find_program_from_env(program: &str) -> String
Expand description

Finds the executable path in the environment.

If the path exists, it returns the constructed path, otherwise just the program name.

§Arguments

  • program - The program name.

§Returns

Returns the fully qualified path if it exists, or the program name if it doesn’t.

§Examples

let found_program = phargs::find_program_from_env("bash");
println!("Found program: {}", found_program);