You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--stream:
Parse the input in streaming fashion, outputting arrays of path
and leaf values (scalars and empty arrays or empty objects).
For example, "a" becomes [[],"a"], and [[],"a",["b"]]
becomes [[0],[]], [[1],"a"], and [[1,0],"b"].
However, the second example is incorrect. jq --stream <<<'[[],"a",["b"]]' actually produces
[[0],[]]
[[1],"a"]
[[2,0],"b"]
[[2,0]]
[[2]]
The manual's example ought to show the correct path for "b", as well as the fact that [<path>] is used to indicate the end of an array in the stream output.
The text was updated successfully, but these errors were encountered:
lily-commure
changed the title
Incorrect documentation for --stream
Incorrect documentation example for --stream
Feb 24, 2020
The manual says:
However, the second example is incorrect.
jq --stream <<<'[[],"a",["b"]]'
actually producesThe manual's example ought to show the correct path for
"b"
, as well as the fact that[<path>]
is used to indicate the end of an array in the stream output.The text was updated successfully, but these errors were encountered: