MiSawa / xq

Pure rust implementation of jq
MIT License
318 stars 18 forks source link

Rework on `-n` #120

Closed MiSawa closed 2 years ago

MiSawa commented 2 years ago

https://github.com/MiSawa/xq/issues/116#issuecomment-1066038523

$ jq -nc 'input' <<< '1 2 3'
1
$ jq -nsc 'input' <<< '1 2 3'
[1,2,3]

I guess we need two streams, one for the things supplied to the program, and another for input/0, where both tied to a single shared iterator usually but does something different for -n?