adjust formatting of output for todoperbackend.show()
This commit is contained in:
@@ -65,18 +65,15 @@ impl ToDoPerBackend {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn show(&self, keyword: Option<&str>) {
|
pub(crate) fn show(&self) {
|
||||||
for (backend, packages) in self.iter() {
|
for (backend, packages) in self.iter() {
|
||||||
if packages.is_empty() {
|
if packages.is_empty() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(kw) = keyword {
|
println!(" [{}]", backend.get_section());
|
||||||
println!("Would {kw} the following packages:");
|
|
||||||
}
|
|
||||||
println!("[{}]", backend.get_section());
|
|
||||||
for package in packages {
|
for package in packages {
|
||||||
println!("{package}");
|
println!(" {package}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-3
@@ -96,7 +96,8 @@ impl Pacdef {
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
to_install.show("install".into());
|
println!("Would install the following packages:");
|
||||||
|
to_install.show();
|
||||||
|
|
||||||
if !get_user_confirmation()? {
|
if !get_user_confirmation()? {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
@@ -141,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(None);
|
unmanaged_per_backend.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_unmanaged_packages(&mut self) -> ToDoPerBackend {
|
fn get_unmanaged_packages(&mut self) -> ToDoPerBackend {
|
||||||
@@ -176,7 +177,8 @@ impl Pacdef {
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
to_remove.show("remove".into());
|
println!("Would remove the following packages");
|
||||||
|
to_remove.show();
|
||||||
|
|
||||||
if !get_user_confirmation()? {
|
if !get_user_confirmation()? {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|||||||
Reference in New Issue
Block a user