Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect documentation example for --stream #2068

Closed
lily-commure opened this issue Feb 24, 2020 · 2 comments
Closed

Incorrect documentation example for --stream #2068

lily-commure opened this issue Feb 24, 2020 · 2 comments

Comments

@lily-commure
Copy link

The manual says:

  • --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.

@lily-commure lily-commure changed the title Incorrect documentation for --stream Incorrect documentation example for --stream Feb 24, 2020
@Alanscut
Copy link
Contributor

PR #2010 has resolved this issue.

@lily-commure
Copy link
Author

Oops, this duplicates #1279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants