jq icon indicating copy to clipboard operation
jq copied to clipboard

Add `--output-file` flag for writing values to file

Open thaliaarchi opened this issue 3 months ago • 1 comments

This is a further development on @christf's #3367 (feat: allow writing to output file), which handles some edge cases not considered.

Other uses of stdout, such as tests, fuzzers, disassembly, and debug traces, remain directed to stdout; only JSON values are written to the output file. Consequently, users of --debug-dump-disasm and --debug-trace can now separate the debug and JSON outputs. On Windows, the output file is marked as binary when --binary is passed.

This incorporates the commit from #3367, but with minor fixes squashed in.

Fixes #2418 Closes #3367

thaliaarchi avatar Sep 17 '25 04:09 thaliaarchi

Well that was a lot of back and forth with CI to identify the problem with Windows :sweat_smile:. I'm confident in this now.

thaliaarchi avatar Sep 17 '25 05:09 thaliaarchi