build_remove_command_for_executor

Function build_remove_command_for_executor 

Source
pub fn build_remove_command_for_executor(
    names: &[String],
    password: Option<&str>,
    cascade: CascadeMode,
    dry_run: bool,
) -> String
Expand description

What: Build remove command string without hold tail for PTY execution.

Inputs:

  • names: Package names to remove.
  • password: Optional sudo password (password is written to PTY stdin when sudo prompts).
  • cascade: Cascade removal mode.
  • dry_run: Whether to run in dry-run mode.

Output:

  • Command string ready for PTY execution (no hold tail).

Details:

  • Uses -R, -Rs, or -Rns based on cascade mode.
  • Uses --noconfirm for non-interactive execution.
  • Always uses sudo -S for remove operations (password written to PTY stdin when sudo prompts).
  • Removes hold tail since we’re not spawning a terminal.