SIGN IN SIGN UP

feat(jq): add raw input mode (-R/--raw-input) (#260)

* feat(jq): add raw input mode (-R/--raw-input)

Builds on #189 by nicoster, rebased onto the current monorepo layout
(packages/just-bash/...) and fixing a file-boundary correctness bug:
real jq concatenates all inputs into a single stream and splits on
newlines, so a raw line spans a file boundary when a file lacks a
trailing newline. Inputs are now concatenated before splitting instead
of being processed per-file.

Adds unit and comparison coverage for stdin, files, blank lines, the
'-' stdin marker, CRLF preservation, and the cross-file-boundary case.

Co-authored-by: Nick Xiao <nick.xiao@zoom.us>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Signed-off-by: Lars Trieloff <lars@trieloff.net>

* fix(jq): align raw-input help with jq, scan raw input incrementally

Address PR review:
- Help: usage FILTER [FILE...], -c long flag is --compact-output (matches
  both the implementation and real jq), and -R wording mirrors jq
  ("read each line as string instead of JSON").
- Raw input now scans inputs incrementally, carrying only the unterminated
  trailing fragment across file boundaries, instead of allocating the full
  concatenated string and a complete array of lines.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Signed-off-by: Lars Trieloff <lars@trieloff.net>

---------

Signed-off-by: Lars Trieloff <lars@trieloff.net>
Co-authored-by: Droid <droid@factory.ai>
Co-authored-by: Nick Xiao <nick.xiao@zoom.us>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
L
Lars Trieloff committed
dfc5d65523420ab482bbb0fd7abde82b22677efe
Parent: d64009a
Committed by GitHub <noreply@github.com> on 6/2/2026, 3:45:06 PM