feat: more quiet sync

Made quiet argument propagate to
child command in sync subcommand
This commit is contained in:
2026-05-30 01:11:43 +02:00
parent 8c83e733c2
commit 062fb4fce8
2 changed files with 13 additions and 10 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ fn main() -> Result<()> {
x.get_package_list()
};
update_packages(&not_installed)?;
update_packages(&not_installed, args.quiet)?;
if !args.quiet {
println!("Succesfully synchronized state with the world file!");
+12 -9
View File
@@ -63,31 +63,34 @@ pub fn remove_packages(packages: &[String], all: bool) -> Result<()> {
Ok(())
}
fn _update_packages(command: Command, packages: &[String]) -> Result<()> {
fn _update_packages(command: Command, packages: &[String], quiet: bool) -> Result<()> {
let mut command = command;
command
.arg("-Syu")
.args(packages)
.stderr(Stdio::inherit())
.stdout(Stdio::inherit())
.stdin(Stdio::inherit())
.status()?;
.stdin(Stdio::inherit());
if quiet {
command.arg("-q");
}
command.status()?;
Ok(())
}
#[cfg(not(any(feature = "yay", feature = "paru")))]
pub fn update_packages(packages: &[String]) -> Result<()> {
pub fn update_packages(packages: &[String], quiet: bool) -> Result<()> {
let mut command = Command::new(PRIVLAGE_ESCELATE_COMMAND);
command.arg("pacman");
_update_packages(command, packages)
_update_packages(command, packages, quiet)
}
#[cfg(feature = "yay")]
pub fn update_packages(packages: &[String]) -> Result<()> {
_update_packages(Command::new("yay"), packages)
pub fn update_packages(packages: &[String], quiet: bool) -> Result<()> {
_update_packages(Command::new("yay"), packages, quiet)
}
#[cfg(feature = "paru")]
pub fn update_packages(packages: &[String]) -> Result<()> {
_update_packages(Command::new("paru"), packages)
pub fn update_packages(packages: &[String], quiet: bool) -> Result<()> {
_update_packages(Command::new("paru"), packages, quiet)
}