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

jq halt_error behaviour difference #109

Closed
wader opened this issue Aug 2, 2021 · 1 comment
Closed

jq halt_error behaviour difference #109

wader opened this issue Aug 2, 2021 · 1 comment

Comments

@wader
Copy link
Contributor

wader commented Aug 2, 2021

jq 1.6

$ jq -n '"abc" | halt_error' 2>&1 | hexdump -C
00000000  61 62 63                                          |abc|
00000003

jq master (d18b2d078c2383d9472d0a0a226e07009025574f)

$ ./jq -n '"abc" | halt_error' 2>&1 | hexdump -C
00000000  6a 71 3a 20 65 72 72 6f  72 3a 20 61 62 63        |jq: error: abc|
0000000e

gojq main

$ ./gojq -n '"abc" | halt_error' 2>&1 | hexdump -C
00000000  67 6f 6a 71 3a 20 65 72  72 6f 72 3a 20 61 62 63  |gojq: error: abc|
00000010  0a                                                |.|
00000011

jq halt_error documentation currently says

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.

There is an issue about jq master adding a prefix at the moment jqlang/jq#1902

null input to halt_error seems behave the same as jq, prints nothing.

@itchyny itchyny closed this as completed in 9a29837 Aug 2, 2021
@itchyny
Copy link
Owner

itchyny commented Aug 2, 2021

Nice find. I fixed this.

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

No branches or pull requests

2 participants