diff --git a/cubi_tk/sodar/lz_list.py b/cubi_tk/sodar/lz_list.py index cddf421..20d6d9d 100644 --- a/cubi_tk/sodar/lz_list.py +++ b/cubi_tk/sodar/lz_list.py @@ -62,6 +62,16 @@ def setup_argparse(cls, parser: argparse.ArgumentParser) -> None: help="Format string for printing, e.g. %%(uuid)s", ) + status = ["ACTIVE", "FAILED", "VALIDATING"] + parser.add_argument( + "--filter-status", + dest="filter_status", + default=set(status), + action="append", + choices=status, + help="Filter landing zone by status. Defaults to listing all.", + ) + parser.add_argument("project_uuid", help="UUID of project to create the landing zone in.") @classmethod @@ -101,7 +111,7 @@ def execute(self) -> typing.Optional[int]: key=lambda lz: lz.date_modified, ) for lz in existing_lzs: - if lz.status != "ACTIVE": + if lz.status not in self.args.filter_status: continue values = cattr.unstructure(lz) if self.args.format_string: