feat: more quiet sync
Made quiet argument propagate to child command in sync subcommand
This commit is contained in:
+1
-1
@@ -121,7 +121,7 @@ fn main() -> Result<()> {
|
|||||||
x.get_package_list()
|
x.get_package_list()
|
||||||
};
|
};
|
||||||
|
|
||||||
update_packages(¬_installed)?;
|
update_packages(¬_installed, args.quiet)?;
|
||||||
|
|
||||||
if !args.quiet {
|
if !args.quiet {
|
||||||
println!("Succesfully synchronized state with the world file!");
|
println!("Succesfully synchronized state with the world file!");
|
||||||
|
|||||||
+12
-9
@@ -63,31 +63,34 @@ pub fn remove_packages(packages: &[String], all: bool) -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn _update_packages(command: Command, packages: &[String]) -> Result<()> {
|
fn _update_packages(command: Command, packages: &[String], quiet: bool) -> Result<()> {
|
||||||
let mut command = command;
|
let mut command = command;
|
||||||
command
|
command
|
||||||
.arg("-Syu")
|
.arg("-Syu")
|
||||||
.args(packages)
|
.args(packages)
|
||||||
.stderr(Stdio::inherit())
|
.stderr(Stdio::inherit())
|
||||||
.stdout(Stdio::inherit())
|
.stdout(Stdio::inherit())
|
||||||
.stdin(Stdio::inherit())
|
.stdin(Stdio::inherit());
|
||||||
.status()?;
|
if quiet {
|
||||||
|
command.arg("-q");
|
||||||
|
}
|
||||||
|
command.status()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(feature = "yay", feature = "paru")))]
|
#[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);
|
let mut command = Command::new(PRIVLAGE_ESCELATE_COMMAND);
|
||||||
command.arg("pacman");
|
command.arg("pacman");
|
||||||
_update_packages(command, packages)
|
_update_packages(command, packages, quiet)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "yay")]
|
#[cfg(feature = "yay")]
|
||||||
pub fn update_packages(packages: &[String]) -> Result<()> {
|
pub fn update_packages(packages: &[String], quiet: bool) -> Result<()> {
|
||||||
_update_packages(Command::new("yay"), packages)
|
_update_packages(Command::new("yay"), packages, quiet)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "paru")]
|
#[cfg(feature = "paru")]
|
||||||
pub fn update_packages(packages: &[String]) -> Result<()> {
|
pub fn update_packages(packages: &[String], quiet: bool) -> Result<()> {
|
||||||
_update_packages(Command::new("paru"), packages)
|
_update_packages(Command::new("paru"), packages, quiet)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user