-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Rename --nul-output to --raw-output0, abort on string containing NUL #2684
Rename --nul-output to --raw-output0, abort on string containing NUL #2684
Conversation
We should first decide whether to keep |
86699b4
to
4c61f65
Compare
Can you remove |
4c61f65
to
26b0dfa
Compare
1729f19
to
ff47773
Compare
There were some proposed options but I'm ok with this plan. What do you think? |
|
Ah, I remember the concern is that it's not abort, but just skip. It exits with non-zero only when the last output contains NUL. |
LGTM! Merge at your convenience. I think this gets us very close to release ready. I need to change the release key's name. And I need to figure quite how to do the signing in the actions, unless you already know. |
ff47773
to
c43f1d3
Compare
Sorry for pushing after reviewing, but I reconsidered that this should be an error. So I |
The option naming --nul-output was confusing, especially when we have a similar option for input stream in the future (--nul-input vs --null-input). Based on the observation of other command line tools, we rename the option to --raw-output0. We also drop the short option -0 to avoid confusion on introducing the NUL-delimited input option. Unlike the other command line tools outputting file names with NUL delimiter, jq deals with JSON, and its strings may contain NUL character. To protect users from the risk of injection attacks, we abort the program and print an error message before outputting strings including NUL character. Closes jqlang#2683.
c43f1d3
to
1ea53bc
Compare
Thanks! |
Remove -0 short arg, now it means the expression "-0". This is to bo in sync with jq 1.7 jqlang/jq#2684 Correct and clarify that NUL and new lines are outputted after and not between each output. Still missing is to abort on output containing zero when using --raw-output0
Remove -0 short arg, now it means the expression "-0". This is to be in sync with jq 1.7 jqlang/jq#2684 Correct and clarify that NUL and new lines are outputted after and not between each output. Still missing is to abort on output containing zero when using --raw-output0
The option naming --nul-output was confusing, especially when we have a
similar option for input stream in the future (--nul-input vs --null-input).
Based on the observation of other command line tools, we rename the option
to --raw-output0. We also drop the short option -0 to avoid confusion on
introducing the NUL-delimited input option.
Unlike the other command line tools outputting file names with NUL delimiter,
jq deals with JSON, and its strings may contain NUL character. To protect
users from the risk of injection attacks, we abort the program and print an
error message before outputting strings including NUL character. Closes #2683.