-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Regression in if-then-else docs #2139
Comments
I noticed this as well. I would also offer that the "else" is not optional (as documented), but is (now) required, as shown in the following code examples (for jq 1.6):
|
If you are using jq 1.6, please refer to https://stedolan.github.io/jq/manual/v1.6/. % print '{"labels":{"owner1":"dls","archived":"","owner2":"data-services"}}' | jq -r '.labels? | if length>0 then "present" end'
present
% jq --version
jq-master-a17dd32 |
*Thanks for the reply.*
I'm using: *jq - commandline JSON processor [version 1.6]*
I simply downloaded the latest (1.6) from the
*https://stedolan.github.io/jq/download/
<https://stedolan.github.io/jq/download/>* page. If there's a newer version
which fixes the above issue, where would I be able to obtain it from?
*Sorry if I should know better, but there's a lot happening at work...*
*jeff smith*
…On Tue, Jul 28, 2020 at 8:39 PM itchyny ***@***.***> wrote:
If you are using jq 1.6, please refer to
https://stedolan.github.io/jq/manual/v1.6/.
In the master version, else is optional as implemented by #1825
<#1825>.
% print '{"labels":{"owner1":"dls","archived":"","owner2":"data-services"}}' | jq -r '.labels? | if length>0 then "present" end'
present
% jq --version
jq-master-a17dd32
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2139 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOTJSCOMGUCQOCTEGNB2TR3R55VURANCNFSM4N23675Q>
.
|
Current latest released version is 1.6. https://stedolan.github.io/jq/manual/ is the manual for |
The docs at https://stedolan.github.io/jq/manual/ currently say:
Note the two expressions there are identical.
Seems to be a regression introduced in 8a02b2c
The text was updated successfully, but these errors were encountered: