build_install_command

Function build_install_command 

Source
pub fn build_install_command(
    item: &PackageItem,
    password: Option<&str>,
    dry_run: bool,
) -> (String, bool)
Expand description

What: Build a shell command to install item and indicate whether sudo is used.

Input:

  • item: Package to install (official via pacman, AUR via helper).
  • password: Optional sudo password; when present, wires sudo -S with a pipe.
  • dry_run: When true, prints the command instead of executing.

Output:

  • Tuple (command_string, uses_sudo) with a shell-ready command and whether it requires sudo.

Details:

  • Uses --needed flag for new installs, omits it for reinstalls.
  • Adds a hold tail so spawned terminals remain open after completion.