[ravedude] add output modes, newline after n bytes or after char
From --help:
-o <output-mode>
Output mode. Can be ascii, hex, dec or bin
--newline-on <newline-on>
Print a newline after this byte
not used with output_mode ascii
hex (0x) and bin (0b) notations are supported.
matching chars/bytes are NOT removed
to add newlines after \n (in non-ascii mode), use \n, 0x0a or 0b00001010
--newline-after <newline-after>
Print a newline after n bytes
not used with output_mode ascii
defaults to 16 for hex and dec and 8 for bin
if dividable by 4, bytes will be grouped to 4
This helps when working with non-ascii output.
Other solutions:
- use another serial console: too much context switching for me, having the serial console in watch mode is way better.
- use ravedude and pipe into hexdump or xxd: they only handle streamed data line by line, meaning the data is not printed immediately. They also can’t add newlines.
Thanks a lot for your contribution! I like this change a lot.
Right now, we are doing a rather large rework of ravedude in #522. I'll get back to your PR once that work is finished, otherwise things will get a bit too messy. I don't expect a lot of conflicts with your changes, though.
Hi, sorry for only getting back to this now. #522 has landed. If you are still interested in pursuing this work here, please rebase ontop of the new code. I think your new options should also be moved into Ravedude.toml now, rather than being CLI options.
I’ll do that. Should I keep output-mode as a cli override? That’s probably the option I’d switch the most.
I keep output-mode as a cli override?
Yeah, I think adding a CLI override is a good idea.
Thanks for the very thorough review, I’ll do that tomorrow. I was happy that my git rebase was successful and also still want to test this with an Arduino.
That should address all your comments, I didn’t test it yet though.
Please run cargo fmt on the code, there seem to be a few formatting issues. Let me know once you have tested it :)
That should do it, sorry for not formatting it right away. I also tested it now, no problems (only that the console info was printed twice, fixed in the last commit. forgot to mention that in the commit message though)