Skip to main content

resolve_command_on_path

Function resolve_command_on_path 

Source
pub fn resolve_command_on_path(cmd: &str) -> Option<PathBuf>
Expand description

What: Resolve an executable on PATH or by explicit path (Unix).

Input:

  • cmd: Program basename or path containing MAIN_SEPARATOR.

Output:

  • Some(path) for the first executable match; otherwise None.

Details:

  • Honour Unix permission bits so a non-executable file on PATH is not treated as a tool.