add showing group content (WIP)

This commit is contained in:
steven-omaha
2023-01-10 18:50:17 +01:00
parent d4c97679e2
commit 42d318298c
3 changed files with 16 additions and 0 deletions
+9
View File
@@ -29,6 +29,7 @@ impl Pacdef {
self.edit_group_files(groups).context("editing group files")
}
Some((action::GROUPS, _)) => Ok(self.show_groups()),
Some((action::SHOW, _)) => Ok(self.show_packages_under_group()),
Some((action::SYNC, _)) => Ok(self.install_packages()),
Some((action::UNMANAGED, _)) => Ok(self.show_unmanaged_packages()),
Some((action::VERSION, _)) => Ok(self.show_version()),
@@ -167,6 +168,14 @@ impl Pacdef {
backend.remove_packages(packages);
}
}
fn show_packages_under_group(&self) {
let groups = self.args.get_many::<String>("group").unwrap();
for arg_group in groups {
let group = self.groups.iter().find(|g| g.name == *arg_group).unwrap();
println!("{group}");
}
}
}
fn show_error(error: anyhow::Error, backend: Box<dyn Backend>) {