pub fn build_update_command(
helper: Option<AurHelper>,
noconfirm: bool,
) -> CommandSpecExpand description
What: Build a full-system update command.
Inputs:
helper: WhenSome, use the AUR helper (paru -Syu) which updates both official and AUR packages. WhenNone, use plainpacman -Syu.noconfirm: Pass--noconfirmfor non-interactive updates.
Output:
CommandSpeclikeparu -Syu --noconfirmorpacman -Syu --noconfirm.
Details:
- The pacman variant requires privilege wrapping (
with_privilege); helper variants must not be wrapped (helpers call sudo themselves).
ยงExample
use arch_toolkit::install::build_update_command;
use arch_toolkit::types::install::AurHelper;
let pacman = build_update_command(None, true);
assert_eq!(pacman.to_shell_string(), "pacman -Syu --noconfirm");
let helper = build_update_command(Some(AurHelper::Yay), false);
assert_eq!(helper.to_shell_string(), "yay -Syu");