feat: respect backup list filter option

export-backup
Jef Roosens 2023-07-04 14:15:00 +02:00
parent f71db90922
commit 36c441b8c2
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 6 additions and 1 deletions

View File

@ -131,7 +131,12 @@ impl BackupListArgs {
pub fn run(&self, cli: &Cli) -> io::Result<()> {
let meta = cli.meta()?;
for (name, manager) in meta.managers().iter() {
// A bit scuffed? Sure
for (name, manager) in meta
.managers()
.iter()
.filter(|(name, _)| self.layer.is_none() || &self.layer.as_ref().unwrap() == name)
{
println!("{}", name);
for chain in manager.chains().iter().filter(|c| !c.is_empty()) {