run_pacman

Function run_pacman 

Source
pub fn run_pacman(args: &[&str]) -> Result<String, Box<dyn Error + Send + Sync>>
Expand description

What: Execute pacman with the provided arguments and capture stdout.

Inputs:

  • args: Slice of CLI arguments passed directly to the pacman binary.

Output:

  • Returns the command’s stdout as a UTF-8 string or propagates execution/parsing errors.

§Errors

  • Returns Err when pacman command execution fails (I/O error or pacman not found)
  • Returns Err when pacman exits with non-zero status
  • Returns Err when stdout cannot be decoded as UTF-8

Details:

  • Used internally by index and logic helpers to keep command invocation boilerplate centralized.