command_on_path

Function command_on_path 

Source
pub fn command_on_path(cmd: &str) -> bool
Expand description

What: Determine whether a command is available on the Unix PATH.

Input:

  • cmd: Program name or explicit path to inspect.

Output:

  • true when an executable file is found and marked executable.

Details:

  • Accepts explicit paths (containing path separators) and honours Unix permission bits.
  • Falls back to scanning PATH, and on Windows builds respects PATHEXT as well.