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
So what does the documentation say about halt_error/1?
Stops the jq program with no further outputs. The input will be printed on stderr as raw output (i.e., strings will not have double quotes) with no decoration, not even a newline.
How is null printed as raw output?
$ jq -rn 'null'
null
So jq -n 'null | halt_error' must print null too, if we follow the documentation. I think that it's better to follow the documentation here, as I find its behaviour simpler and less confusing. A user can always use something like if . == null then "" end | halt_error to get jq's behaviour.
I seems @nicowilliams wrote the "Halt with no output" comment for null, would be great to hear what he thinks or what the idea was? maybe @itchyny has some ideas also? fix jq or fix jq docs?
Can't find this in documentation but there is a comment about in the code https://github.com/jqlang/jq/blob/master/src/main.c#L228-L229
Noticed this while messing with jqjq run-tests code.
Missing
halt_error/0
is define liks this in jq:The text was updated successfully, but these errors were encountered: