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

Fix to incorrect --stream paths #2010

Closed
wants to merge 2 commits into from

Commits on Nov 14, 2019

  1. Fix to incorrect --stream paths

    Thought something was wrong with the example provided against the --stream option. Proved that the index of the path to "b" was incorrect by running the example on the terminal.  Instead of `[[1,0],"b"]` it should read `[[2,0],"b"]` . 
    
    Additionally, this isn't the whole stream, as given it's depth-first, after visiting descendants, it will visit the ancestor containers too. However I guess these have been omitted deliberately for brevity? 
    
    If you prefer the full sequence I'll force push a fix to this PR branch which contains the ancestors traversed too.  
    
    ## Example in terminal
    
    ```
    echo '[[],"a",["b"]]' | jq --stream --compact-output
    [[0],[]]
    [[1],"a"]
    [[2,0],"b"]
    [[2,0]]
    [[2]]
    ```
    cefn authored Nov 14, 2019
    Configuration menu
    Copy the full SHA
    b247d8f View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2019

  1. Included full stream output

    Prompted by...
    jqlang#2010 (comment)
    cefn authored Dec 20, 2019
    Configuration menu
    Copy the full SHA
    ec29d7e View commit details
    Browse the repository at this point in the history