Skip to content
Closed
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
5 changes: 5 additions & 0 deletions tests/test_fog_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ def test_cli_validation_guards(self):
with self.assertRaises(SystemExit) as cm:
fv.main([os.path.join(td, "missing.rpf")])
self.assertEqual(cm.exception.code, 2)
# Refuses a worker count the run cannot honour
for jobs in ("0", "-4"):
with self.assertRaises(SystemExit) as cm:
fv.main([fp, "--jobs", jobs])
self.assertEqual(cm.exception.code, 2)


if __name__ == "__main__":
Expand Down
4 changes: 3 additions & 1 deletion tools/fog_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,12 @@ def main(argv=None) -> int:
ap.add_argument("path", help="RPF9 archive, carved 0x7a file, or folder of carved files")
ap.add_argument("--out", help="optional JSON summary output path")
ap.add_argument("--jobs", type=int, default=min(16, os.cpu_count() or 4),
help="worker processes for RPF9 scanning")
help="worker processes for RPF9 scanning (at least 1)")
a = ap.parse_args(argv)
if not os.path.exists(a.path):
ap.error(f"no such file or folder: {a.path}")
if a.jobs < 1:
ap.error(f"--jobs must be at least 1: {a.jobs}")
if a.out:
if os.path.isdir(a.out):
ap.error(f"--out is a directory: {a.out}")
Expand Down