Introduce raw0 format for zero-terminated strings#388
Conversation
01mf02
left a comment
There was a problem hiding this comment.
This looks already quite good! Thanks for your effort!
7224222 to
902bab8
Compare
|
Okay. I removed the I've also refactored the |
This is great! I'm now happy with the functionality (except for
I think that the |
|
I would also eliminate the functions |
|
Better now? I'll squash the fixups and wait for the feedback on |
This is definitely going in the right direction. I left you some more comments. Thank you so much already for your dedication. And a happy new year, by the way. ;) |
jaq-fmts/src/write/formats.rs
Outdated
| // end of YAML document | ||
| writeln!(w, "...")? | ||
| } | ||
| Ok(()) |
There was a problem hiding this comment.
This Ok(()) can be omitted because of the flush before.
|
I went ahead and did the last changes myself. Now I think that this PR is complete. Let's leave it like it is and wait for the comments on slurping. Have a nice weekend! |
|
I've squashed all the fixup commits. Let's see what happens one the |
|
Hi @pjungkamp! There is no activity on jqlang/jq#3456, so I think I'm fine to go ahead with the Do you have any other thoughts about this? |
|
I just noticed that you had already added tests and documentation. I consider the PR ready. |
Thanks for your heads up. Because the documentation did not cover |
I took some time to check the features and issue tracker of other The active discussion on I think we're pretty safe here. The I can't predict the future and may be totally wrong here but I hope I at least did my research properly. |
Thanks a lot for your thorough research! I will now merge this. |
This implements a
raw0format that can be used for zero-terminated strings as both input and output ofjaq. I also added ajqcompatible--raw-output0switch, which is essentially just an alias for--to raw0.Use case
I want to be able to safely use UNIX utilities with
jaq. Especially the safe enumeration of files usingfind -print0and batch process execution usingxargs -0would make me more confident in using jaq for shell scripting.Examples
roundtrip conversion
jq compatibility
find -print0Resolves #101