Remove trailing spaces in hexdump output#219
Conversation
|
(feature was initially added in #175 where there's some discussion about output) |
|
Lgtm; fixing the trailing spaces and newline sounds good! I just noticed that cstruct doesn't use ocaml-hex from mirage, but the extra dependency probably isnt worth it |
|
well, I'd welcome a single to/of_hex -- i.e. Cstruct using the hex library instead of containing the very same code once more... I thought we discussed this somewhere, but I'm unable to find the discussion :/ having said this, I'm ok with these changes - but would appreciate them to be applied to the hex library and that being used here :) |
|
OK, I'll do the fixes here first and merge the implementations in a separate PR. At the moment, |
|
@emillon great, thanks! |
|
I removed the spaces and used a vbox instead of forcing a newline. As for the trailing newline, after trying I don't think it's For example, let's say we're trying to write some text and a hanging hexdump: At the moment there is no trailing newline. But forcing a break will insert spaces (indicated by Which makes it impossible to output things like: So, we can merge this as this already fixes the trailing spaces, and try to think of a better solution once it's merged with |
|
thanks! |
…struct-lwt (3.5.0) CHANGES: - Remove trailing spaces in hexdump output (mirage/ocaml-cstruct#219 @emillon) - Add `Cstruct.rev` to allocate a reversed cstruct (mirage/ocaml-cstruct#221 @emillon) - `Cstruct_unix` now uses the post-OCaml 4.06 `Unix.map_file` instead of the deprecated Bigarray `map_file` that was removed in OCaml 4.08 (@avsm, see ocaml/ocaml#2263) - Remove unnecessary `(wrapped false)` in the build system (@avsm) - Correct ocamldoc to the right `cstruct-ppx` package pointer (@avsm)
Hello,
I added some tests for
hexdump_pp.The formatting seems a bit off to me:
I believe that the trailing spaces should be removed, but I'm not too sure about the trailing newlines.
Let me know what you think.