Skip to content

Commit 11c702e

Browse files
Sanity checks now have multiple modes (file, file-list, dir, all volumes)
1 parent 8865bd4 commit 11c702e

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
- Unit tests for config, CLI, login parsing, scope resolution, and URL helpers
1313
- `check` command renamed to `doctor`
1414
- `repo` command renamed to `volumes`
15+
- the 'volumes` command can now scan files in multiple modes: file (-f, or --file), file-list (-l, or --list),
16+
directory (-d, or --dir) or all volumes (--sanity-files)
17+
1518

1619
0.0.1
1720

src/cmd_volumes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,11 @@ def sanity_db(cm: ConfigManager, args) -> int:
476476
def cmd_volumes(cm: ConfigManager, args) -> int:
477477
"""Manages the on disk images repository."""
478478

479-
if args.sanity_files:
479+
if args.file or args.list or args.dir or args.all_files:
480480
return sanity_files(cm, args)
481481

482482
if args.sanity_db:
483483
return sanity_db(cm, args)
484484

485-
print("ERROR: No sanity check selected. Use --sanity-files or --sanity-db to check the repository.")
485+
print("ERROR: No sanity check selected. Use -d (--dir) or -l (--list) or -f (--file) or -a (--all-files) or --sanity-db to check the repository.")
486486
return 1

src/hevelius-runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,8 @@ def build_parser() -> argparse.ArgumentParser:
359359
repo_parser.add_argument("-d", "--dir", help="Check all FITS files recursively in this specific directory", type=str)
360360
repo_parser.add_argument("-s", "--show-header", help="Displays all entries in FITS header for each file", action='store_true')
361361
repo_parser.add_argument("-t", "--dry-run", help="Don't do the actual DB upsert", action='store_true')
362+
repo_parser.add_argument("-a", "--all-files", help="Check files against tasks; defaults to scanning all configured paths.volumes when no --file/--list/--dir is given", action='store_true')
362363
repo_parser.add_argument("--sanity-db", help="Goes through the list of tasks in a database and checks if all files are present", action='store_true')
363-
repo_parser.add_argument("--sanity-files", help="Check files against tasks; defaults to scanning all configured paths.volumes when no --file/--list/--dir is given", action='store_true')
364364
repo_parser.add_argument("--min-task-id", help="Minimum task ID to check (for sanity-db)", type=int)
365365
repo_parser.add_argument("--max-task-id", help="Maximum task ID to check (for sanity-db)", type=int)
366366
repo_parser.add_argument("--delete-invalid", help="Delete invalid tasks (no filename or missing file) when using sanity-db", action='store_true')

0 commit comments

Comments
 (0)