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
Just as I posted this, I found a solution here. However, I think the docs need to be expanded on those two functions (halt, and halt_error) to explain that they only work when jq is run with -n.
@smac89 - The issue you raise could be regarded entirely as a documentation issue. Indeed, the jq developers have generally been quite definite about not wanting to break the stream-processing character of jq - i.e., assuming that input has not been "slurped", and that each input is well-formed, each input is processed separately.
Describe the bug
From the
v1.6
jq docs, it says thathalt
does the following:However, from my testing of both
halt
andhalt_error
, neither of them causes jq to terminate with no further outputs.To Reproduce
Input:
Command:
jq '.value | if .error then "\(.message)\n" | halt_error(1) else "" end'
Output:
Expected behavior
There should only be one output, seeing as after reading the first object, it causes
halt_error
to runEnvironment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: