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 --exit-code issues #1142 and #1139 #1697

Merged
merged 1 commit into from
Dec 18, 2018

Conversation

ryo1kato
Copy link
Contributor

This is a rebase of PR #1140 to the latest master.

* Set default error code to -4 in main(), Fixes jqlang#1142
* fix --exit-code with more than one object in input, Fixes jqlang#1139
    - Return code 1 or 4 based on last output, not last input.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 84.588% when pulling 949e1ce on ryo1kato:fix-exit-code2-cherry into 90bc29c on stedolan:master.

@dongcarl
Copy link

dongcarl commented Nov 9, 2018

Are there any updates on this? Would love for it to be merged as it's very much needed when using jq in shell scripts.

@nicowilliams nicowilliams merged commit 6d3d275 into jqlang:master Dec 18, 2018
@nicowilliams
Copy link
Contributor

Thanks!

@DrStrangepork
Copy link

This merge did not fix the problem in #1142

# echo | jq -e .; echo $?
0

@xiruizhao
Copy link

This merge did not fix the problem in #1142

# echo | jq -e .; echo $?
0

because this commit is merged after the jq 1.6 release. Hopefully the maintainer will release a new version soon.

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

Successfully merging this pull request may close these issues.

jq -e always returns 0 for empty input jq -e returns 4 for non-empty output with select()
6 participants