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

add nested array indexing example #1849

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevpl
Copy link

@kevpl kevpl commented Feb 26, 2019

This PR adds an example to the docs to help people who've hit the snag
discussed in #1168.

Having an example allows people who hit this snag to relatively quickly
see what they've done wrong, rather than having to probe further into a
cryptic error message:

jq: error: syntax error, unexpected $end, expecting FORMAT or QQSTRING_START (Unix shell quoting issues?)

Having it just as an example allows people to be informed of the behavior
without the burden of needing to explain it with additional text.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 84.641% when pulling 037f8ba on kevpl:array_nested_example into 6df393c on stedolan:master.

@nicowilliams
Copy link
Contributor

I mean, the manual is littered with examples like this, but I guess the point is that just the section on array indexing can confuse people, so I'll take it.

@@ -378,6 +378,10 @@ sections:
input: '[1,2,3]'
output: ['2']

- program: '.letters[1]'
input: '{"letters":["a","b","c","d"]}'
output: '"b"'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be output: ['"b"'].

Copy link
Contributor

@itchyny itchyny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example output needs to be corrected as commented before.

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

Successfully merging this pull request may close these issues.

5 participants