This commit is contained in:
steven-omaha
2023-02-13 13:32:37 +01:00
parent d39b2536a1
commit 76717c9503
2 changed files with 12 additions and 6 deletions
+7 -1
View File
@@ -65,14 +65,20 @@ impl ToDoPerBackend {
Ok(()) Ok(())
} }
pub(crate) fn show(&self) { pub(crate) fn show(&self, indentend: bool) {
for (backend, packages) in self.iter() { for (backend, packages) in self.iter() {
if packages.is_empty() { if packages.is_empty() {
continue; continue;
} }
if indentend {
print!(" ");
}
println!("[{}]", backend.get_section()); println!("[{}]", backend.get_section());
for package in packages { for package in packages {
if indentend {
print!(" ");
}
println!(" {package}"); println!(" {package}");
} }
} }
+3 -3
View File
@@ -97,7 +97,7 @@ impl Pacdef {
} }
println!("Would install the following packages:"); println!("Would install the following packages:");
to_install.show(); to_install.show(true);
if !get_user_confirmation()? { if !get_user_confirmation()? {
return Ok(()); return Ok(());
@@ -142,7 +142,7 @@ impl Pacdef {
fn show_unmanaged_packages(mut self) { fn show_unmanaged_packages(mut self) {
let unmanaged_per_backend = &self.get_unmanaged_packages(); let unmanaged_per_backend = &self.get_unmanaged_packages();
unmanaged_per_backend.show(); unmanaged_per_backend.show(false);
} }
fn get_unmanaged_packages(&mut self) -> ToDoPerBackend { fn get_unmanaged_packages(&mut self) -> ToDoPerBackend {
@@ -178,7 +178,7 @@ impl Pacdef {
} }
println!("Would remove the following packages"); println!("Would remove the following packages");
to_remove.show(); to_remove.show(true);
if !get_user_confirmation()? { if !get_user_confirmation()? {
return Ok(()); return Ok(());