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.

Inputs:

  • cmd: Program basename or path containing a path separator.

Output:

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

Details:

  • When cmd contains a path separator, only that path is checked.
  • Otherwise, each PATH directory is searched in order.