jqlang / jq

Command-line JSON processor
https://jqlang.github.io/jq/
Other
30.23k stars 1.57k forks source link

fix option parsing of `--binary` on non-Windows platforms #3131

Closed calestyo closed 4 months ago

calestyo commented 4 months ago

-b/--binary should be accepted on all platforms so that they can be used in code that is meant to be portable.

wader commented 4 months ago

Hey, thanks! look good to me. I wonder if we should add a regression test for this in shtest?

calestyo commented 4 months ago

For this particular case I, personally, would rather it's not worth a test.

The test would only tell when the option parsing itself fails again, which I guess is unlikely, but even if, it would be something that's quickly noticed.

I'd rather like to see tests that check whether the different combinations of --binary and the --raw* options produce the same results per platform and with single/multiple values returned and with values which contain encoded LF and/or CRLF-newlines (see the point I've mentioned in #3132).