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()
|
||||
};
|
||||
|
||||
update_packages(¬_installed)?;
|
||||
update_packages(¬_installed, args.quiet)?;
|
||||
|
||||
if !args.quiet {
|
||||
println!("Succesfully synchronized state with the world file!");
|
||||
|
||||
+12
-9
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user