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