From 100af0035ec4ec26a8e521ea44c4a2b8bc99f681 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 16 Feb 2014 23:54:17 +0000 Subject: docs: make hexdump.1 color specification easier to understand Fix also spacing, input line lenghts, and troff table for data that is a table. Signed-off-by: Sami Kerola --- text-utils/hexdump.1 | 72 ++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/text-utils/hexdump.1 b/text-utils/hexdump.1 index 8b4bf275d..edf5d6f9c 100644 --- a/text-utils/hexdump.1 +++ b/text-utils/hexdump.1 @@ -226,46 +226,46 @@ displayed as a single Output US ASCII characters, with the exception that control characters are displayed using the following, lower-case, names. Characters greater than 0xff, hexadecimal, are displayed as hexadecimal strings. -.PP -.nf - 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq - 006 ack 007 bel 008 bs 009 ht 00A lf 00B vt - 00C ff 00D cr 00E so 00F si 010 dle 011 dc1 - 012 dc2 013 dc3 014 dc4 015 nak 016 syn 017 etb - 018 can 019 em 01A sub 01B esc 01C fs 01D gs - 01E rs 01F us 0FF del -.nf +.RS 10 +.TS +tab(|); +left l l l l l. +000 nul|001 soh|002 stx|003 etx|004 eot|005 enq +006 ack|007 bel|008 bs|009 ht|00A lf|00B vt +00C ff|00D cr|00E so|00F si|010 dle|011 dc1 +012 dc2|013 dc3|014 dc4|015 nak|016 syn|017 etb +018 can|019 em|01A sub|01B esc|01C fs|01D gs +01E rs|01F us|0FF del +.TE .SS Colors -When put at the end of a format specifier, hexdump highlights the respective -string with the color specified. Conditions, if present, are evaluated -prior to highlighting. -.TP -.B \&_L[color_unit_1,color_unit_2,...,color_unit_n] -.TP +When put at the end of a format specifier, hexdump highlights the +respective string with the color specified. Conditions, if present, are +evaluated prior to highlighting. +.PP +.B \&_L[color_unit_1,\:color_unit_2,\:...,\:color_unit_n] +.PP The full syntax of a color unit is as follows: -.TP -.B [!]COLOR[:HEX_VAL|:OCT_VAL|:STRING][@DEC_OFFT|@DEC_OFFT_START-DEC_OFFT_END] +.PP +.B [!]COLOR\:[:VALUE]\:[@OFFSET_START[-END]] .TP .B ! -Negate the condition. Please note that it only makes sense to negate -a unit if both a value/string and an offset are specified. In that case -the respective output string will be highlighted if and only if the value/string -does not match the one at the offset. -.PP +Negate the condition. Please note that it only makes sense to negate a +unit if both a value/\:string and an offset are specified. In that case +the respective output string will be highlighted if and only if the +value/\:string does not match the one at the offset. +.TP .BR COLOR One of the 8 basic shell colors. -.PP -.BR HEX_VAL , OCT_VAL -A value to be matched specified in hexadecimal or octal base. -.PP -.BR STRING -A string to be matched. Please note that the usual C escape sequences -are not interpreted by hexdump inside the color_units. -.PP -.BR DEC_OFFT , DEC_OFFT_START , DEC_OFFT_END -An offset or an offset range at which -to check for a match. Please note that DEC_OFFT is equal to DEC_OFFT-DEC_OFFT. -Also, the range may not be larger than the respective format byte count. +.TP +.B VALUE +A value to be matched specified in hexadecimal, or octal base, or as a +string. Please note that the usual C escape sequences are not +interpreted by hexdump inside the color_units. +.TP +.B OFFSET +An offset or an offset range at which to check for a match. Please note +that lone OFFSET_START uses the same value as END offset. Also, the +range may not be larger than the respective format byte count. .SS Counters The default and supported byte counts for the conversion characters are as follows: @@ -345,8 +345,8 @@ Implement the \-x option: "%07.7_ax " 8/2 "%04x " "\en" .nf .PP -MBR Boot Signature example: -Highlight the addresses cyan and the bytes at offsets 510 and 511 green if their value is 0xAA55, red otherwise. +MBR Boot Signature example: Highlight the addresses cyan and the bytes at +offsets 510 and 511 green if their value is 0xAA55, red otherwise. .nf "%07.7_Ax_L[cyan]\en" "%07.7_ax_L[cyan] " 8/2 " %04x_L[green:0xAA55@510-511,!red:0xAA55@510-511] " "\en" -- cgit v1.2.3-55-g7522