Fix CLI stdout count report + add regression test

Devin Review caught that `--out -` discarded the sample count, so
the stderr summary always said 'wrote 0 sample(s)' even when bytes
were streamed. Capture the return value like the file-output branch
does, and add a regression test that exercises the stdout path.

Co-Authored-By: adrian kuman firmansah <adriancuman@gmail.com>
This commit is contained in:
Devin AI
2026-04-25 20:27:47 +00:00
parent 6003d96a94
commit 1b026ec6f4
2 changed files with 17 additions and 2 deletions

View File

@@ -101,9 +101,8 @@ def main(argv: list[str] | None = None) -> int:
)
out: Path = args.out
count = 0
if str(out) == "-":
_write_stream(sys.stdout.buffer, filters)
count = _write_stream(sys.stdout.buffer, filters)
else:
out.parent.mkdir(parents=True, exist_ok=True)
with out.open("wb") as fh: