Fix --raw to output raw content to stdout

--raw without -o now streams raw content to stdout instead of showing metadata

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-12 17:59:59 +00:00
parent 1a768370f6
commit eb0a38b087

View File

@@ -870,8 +870,8 @@ def view(cid, output, raw):
url = f"{get_server()}/cache/{cid}"
try:
if output == "-":
# Stream to stdout for piping
if output == "-" or (raw and not output):
# Stream to stdout for piping (--raw without -o also goes to stdout)
resp = requests.get(url, stream=True)
resp.raise_for_status()
for chunk in resp.iter_content(chunk_size=8192):