Skip to main content

detect_aur_helper

Function detect_aur_helper 

Source
pub fn detect_aur_helper() -> Option<AurHelper>
Expand description

What: Detect the preferred AUR helper available on PATH.

Inputs: None.

Output:

  • Some(AurHelper::Paru) when paru is available.
  • Some(AurHelper::Yay) when only yay is available.
  • None when neither helper is installed.

Details:

  • Preference order (paru first, yay fallback) matches Pacsea’s install flow.
  • Detection is explicit: command builders never call this implicitly, so callers can override the choice (e.g., from user configuration).

§Example

use arch_toolkit::install::detect_aur_helper;

match detect_aur_helper() {
    Some(helper) => println!("Using AUR helper: {helper}"),
    None => eprintln!("No AUR helper (paru/yay) found."),
}