Extended hexadecimal mode.

While in hex mode (ctrl-t h) you can output hexadecimal values.
E.g.: to send 0x0A you have to type 0A (always 2 characters).

Added option -x, --hex to start in hexadecimal mode.

Added option --newline-in-hex to interpret newline characters in hex mode.
This is disabled by default, because, in my opinion, hex stream is
fundamentally different from text, so a "new line" is meaningless in this
context.
This commit is contained in:
g0mb4 2021-07-19 11:32:00 +02:00 committed by Martin Lund
parent 7d3b687eb4
commit 0b55981e52
5 changed files with 128 additions and 20 deletions

View file

@ -29,7 +29,7 @@ char ansi_format[30];
void print_hex(char c)
{
if ((c == '\n') || (c == '\r'))
if (((c == '\n') || (c == '\r')) && option.newline_in_hex)
{
printf("%c", c);
}