Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions audiness/commands/scans.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ def list(ctx: typer.Context):
def export(
ctx: typer.Context,
identifier: Annotated[
str, typer.Option(help="String for the identification", prompt=True)
str,
typer.Option(
help="String for the identification. Use 'backup_all' to export all scans of the instance",
prompt=True,
),
] = "SAS",
path: Annotated[
Optional[Path],
Expand All @@ -74,9 +78,14 @@ def export(
failed_exports = []
relevant_scans = []

for scan in scans["scans"]:
if scan["name"].startswith(identifier) and scan["status"] == "completed":
relevant_scans.append(scan)
if identifier == "backup_all":
for scan in scans["scans"]:
if scan["status"] == "completed":
relevant_scans.append(scan)
else:
for scan in scans["scans"]:
if scan["name"].startswith(identifier) and scan["status"] == "completed":
relevant_scans.append(scan)

# Export all scans which matches the identifier
for scan in track(relevant_scans, description="Processing scans ..."):
Expand Down
Loading