diff --git a/src/builder/paccache.rs b/src/builder/paccache.rs index c823ebc..884e45d 100644 --- a/src/builder/paccache.rs +++ b/src/builder/paccache.rs @@ -3,25 +3,25 @@ use crate::internal::{commands::ShellCommand, error::AppResult}; #[derive(Debug, Default)] pub struct PaccacheBuilder { keep: i32, - keep_ins: bool, - quiet: bool, + keep_ins_pkgs: bool, + quiet_output: bool, } impl PaccacheBuilder { - pub fn keep(mut self, keep: i32) -> Self { + pub fn set_keep(mut self, keep: i32) -> Self { self.keep = keep; self } - pub fn keep_ins(mut self, keep_ins: bool) -> Self { - self.keep_ins = keep_ins; + pub fn keep_ins_pkgs(mut self, keep_ins_pkgs: bool) -> Self { + self.keep_ins_pkgs = keep_ins_pkgs; self } - pub fn quiet(mut self, quiet: bool) -> Self { - self.quiet = quiet; + pub fn quiet_output(mut self, quiet_output: bool) -> Self { + self.quiet_output = quiet_output; self } @@ -30,11 +30,11 @@ impl PaccacheBuilder { pub async fn remove(self) -> AppResult<()> { let mut command = ShellCommand::paccache().elevated(); - if self.quiet { + if self.quiet_output { command = command.arg("-q"); } - if self.keep_ins { + if self.keep_ins_pkgs { command = command.arg("-u") } diff --git a/src/internal/config.rs b/src/internal/config.rs index ddfbfcf..fdcad00 100644 --- a/src/internal/config.rs +++ b/src/internal/config.rs @@ -18,7 +18,7 @@ pub struct Config { pub struct ConfigBase { pub pacdiff_warn: bool, pub paccache_keep: i32, - pub paccache_keep_ins: bool, + pub paccache_keep_ins_pkgs: bool, } #[derive(Debug, Deserialize, Serialize, Default)] @@ -37,7 +37,7 @@ impl Default for ConfigBase { Self { pacdiff_warn: true, paccache_keep: 0, - paccache_keep_ins: true, + paccache_keep_ins_pkgs: true, } } } diff --git a/src/operations/clean.rs b/src/operations/clean.rs index fd8415e..2485caa 100644 --- a/src/operations/clean.rs +++ b/src/operations/clean.rs @@ -91,9 +91,9 @@ pub async fn clean(options: Options) { // keeps 0 versions of the package in the cache by default // keeps installed packages in the cache by default let result = PaccacheBuilder::default() - .keep(conf.base.paccache_keep) - .keep_ins(conf.base.paccache_keep_ins) - .quiet(quiet) + .set_keep(conf.base.paccache_keep) + .keep_ins_pkgs(conf.base.paccache_keep_ins_pkgs) + .quiet_output(quiet) .remove() .await;