Bug#281124: vim: Various very very minor things regarding xxd's manpage

Nicolas François Nicolas François , 281124@bugs.debian.org
Sat, 13 Nov 2004 23:00:01 +0100


--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: vim
Version: 1:6.3-025+1
Severity: minor
File: /usr/bin/xxd
Tags: patch

Hello,

I'm commenting the attached patch:
(every type of correction is commented only once)


< .BR uuencode(1)
> .BR uuencode (1)
I think .BR was used to alternate bold and regular. This way, uuencode is
in bold, and (1) in the regular font.

< .RB \` \- '
> .RB ` \- '
\` is the grave accent. ` will make a very cute single quote.
(This only makes a difference on UTF-8 terminals)

< This option writes octets as eight digits "1"s and "0"s instead of a normal
> This option writes bytes as eight digits "1"s and "0"s instead of a normal
s/octet/byte/

< .I \-r
< : revert with
> .IR \-r :
> revert with
This permits to avoid the extra space between -r and the colon.

< .I \-s [\+][\-]seek
> .I \-s [+][\-]seek
No need to escape plus signs

< \fI \+ \fR: before the current stdin file position).
> \fI+\fR: before the current stdin file position).
Idem, and remove an extra space, which tells groff not to continue on the
same line.

< \fI% xxd \-i \< file\fR
> \fI% xxd \-i < file\fR
No need to escape <

< .I xxd \-s seek
< , as lseek(2) is used to "rewind" input.  A '+'
> .IR "xxd \-s seek" ,
> as lseek(2) is used to "rewind" input.  A '+'
This avoid an extra space between the coma and "seek".

< \fI% sh \-c 'cat > plain_copy; xxd \-s 0 > hex_copy' < file
> \fI% sh \-c "cat > plain_copy; xxd \-s 0 > hex_copy" < file
' is a "cute" single quote. It will annoy users with UTF-8 terminals if
they want to cut & paste this command.

< Hexdump from file position 0x100 ( = 1024-768) on.
> Hexdump from file position 0x100 ( = 1024\-768) on.
minus signs need to be escaped (- is an hyphen, not convenient for cut &
paste on UTF-8 terminals)

< .B file
< \.
> .BR file .
Otherwise, the dot is not displayed

As you can see, all these are very minor.
hth,
-- 
Nekral

--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="xxd.1.patch"

--- xxd.1.orig	2004-11-13 21:40:07.000000000 +0100
+++ xxd.1	2004-11-13 22:25:51.000000000 +0100
@@ -21,9 +21,9 @@
 creates a hex dump of a given file or standard input.
 It can also convert a hex dump back to its original binary form.
 Like
-.BR uuencode(1)
+.BR uuencode (1)
 and
-.BR uudecode(1)
+.BR uudecode (1)
 it allows the transmission of binary data in a `mail-safe' ASCII representation,
 but has the advantage of decoding to standard output.
 Moreover, it can be used to perform binary file patching.
@@ -34,12 +34,12 @@
 If
 .I infile
 is specified as a
-.RB \` \- '
+.RB ` \- '
 character, then input is taken from standard input.
 If no
 .I outfile
 is given (or a
-.RB \` \- '
+.RB ` \- '
 character is in its place), results are sent to standard output.
 .PP
 Note that a "lazy" parser is used which does not check for more than the first
@@ -61,7 +61,7 @@
 .TP
 .IR \-b " | " \-bits
 Switch to bits (binary digits) dump, rather than hexdump.
-This option writes octets as eight digits "1"s and "0"s instead of a normal
+This option writes bytes as eight digits "1"s and "0"s instead of a normal
 hexacecimal dump. Each line is preceded by a line number in hexadecimal and
 followed by an ascii (or ebcdic) representation. The command line switches
 \-r, \-p, \-i do not work with this mode.
@@ -70,7 +70,7 @@
 .IR "\-c cols " | " \-cols cols"
 format
 .RI < cols >
-octets per line. Default 16 (\-i: 12, \-ps: 30, \-b: 6). Max 256.
+bytes per line. Default 16 (\-i: 12, \-ps: 30, \-b: 6). Max 256.
 .TP
 .IR \-E " | " \-EBCDIC
 Change the character encoding in the righthand column from ASCII to EBCDIC.
@@ -98,7 +98,7 @@
 .IR "\-l len " | " \-len len"
 stop after writing
 .RI  < len >
-octets.
+bytes.
 .TP
 .IR \-p " | " \-ps " | " \-postscript " | " \-plain
 output in postscript continuous hexdump style. Also known as plain hexdump
@@ -115,19 +115,19 @@
 .TP
 .I \-seek offset
 When used after
-.I \-r
-: revert with
+.IR \-r :
+revert with
 .RI < offset >
 added to file positions found in hexdump.
 .TP
-.I \-s [\+][\-]seek
+.I \-s [+][\-]seek
 start at
 .RI < seek >
 bytes abs. (or rel.) infile offset.
-\fI\+ \fRindicates that the seek is relative to the current stdin file position
+\fI+ \fRindicates that the seek is relative to the current stdin file position
 (meaningless when not reading from stdin).  \fI\- \fRindicates that the seek
 should be that many characters from the end of the input (or if combined with
-\fI \+ \fR: before the current stdin file position).
+\fI+\fR: before the current stdin file position).
 Without \-s option, xxd starts at the current file position.
 .TP
 .I \-u
@@ -160,12 +160,12 @@
 .br
 and
 .br
-\fI% xxd \-i \< file\fR
+\fI% xxd \-i < file\fR
 .PP
-.I xxd \-s \+seek
+.I xxd \-s +seek
 may be different from
-.I xxd \-s seek
-, as lseek(2) is used to "rewind" input.  A '+'
+.IR "xxd \-s seek" ,
+as lseek(2) is used to "rewind" input.  A '+'
 makes a difference if the input source is stdin, and if stdin's file position
 is not at the start of the file by the time xxd is started and given its input.
 The following examples may help to clarify (or further confuse!)...
@@ -173,17 +173,17 @@
 Rewind stdin before reading; needed because the `cat' has already read to the
 end of stdin.
 .br
-\fI% sh \-c 'cat > plain_copy; xxd \-s 0 > hex_copy' < file
+\fI% sh \-c "cat > plain_copy; xxd \-s 0 > hex_copy" < file
 .PP
 Hexdump from file position 0x480 (=1024+128) onwards.
 The `+' sign means "relative to the current position", thus the `128' adds to
 the 1k where dd left off.
 .br
-\fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet' < file
+\fI% sh \-c "dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet" < file
 .PP
-Hexdump from file position 0x100 ( = 1024-768) on.
+Hexdump from file position 0x100 ( = 1024\-768) on.
 .br
-\fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +-768 > hex_snippet' < file
+\fI% sh \-c "dd of=plain_snippet bs=1k count=1; xxd \-s +\-768 > hex_snippet" < file
 .PP
 However, this is a rare situation and the use of `+' is rarely needed.
 the author prefers to monitor the effect of xxd with strace(1) or truss(1), whenever \-s is used.
@@ -191,20 +191,18 @@
 .PP
 .br
 Print everything but the first three lines (hex 0x30 bytes) of
-.B file
-\.
+.BR file .
 .br
 \fI% xxd \-s 0x30 file
 .PP
 .br
 Print 3 lines (hex 0x30 bytes) from the end of
-.B file
-\.
+.BR file .
 .br
 \fI% xxd \-s \-0x30 file
 .PP
 .br
-Print 120 bytes as continuous hexdump with 40 octets per line.
+Print 120 bytes as continuous hexdump with 40 bytes per line.
 .br
 \fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR
 .br
@@ -222,7 +220,7 @@
 .br
 
 .br
-Hexdump the first 120 bytes of this man page with 12 octets per line.
+Hexdump the first 120 bytes of this man page with 12 bytes per line.
 .br
 \fI% xxd \-l 120 \-c 12 xxd.1\fR
 .br
@@ -260,13 +258,13 @@
 .B output_file
 and prepend 100 bytes of value 0x00.
 .br
-\fI% xxd input_file | xxd \-r \-s 100 \> output_file\fR
+\fI% xxd input_file | xxd \-r \-s 100 > output_file\fR
 .br
 
 .br
 Patch the date in the file xxd.1
 .br
-\fI% echo '0000029: 3574 68' | xxd \-r \- xxd.1\fR
+\fI% echo "0000029: 3574 68" | xxd \-r \- xxd.1\fR
 .br
 \fI% xxd \-s 0x28 \-l 12 \-c 12 xxd.1\fR
 .br
@@ -276,7 +274,7 @@
 Create a 65537 byte file with all bytes 0x00,
 except for the last one which is 'A' (hex 0x41).
 .br
-\fI% echo '010000: 41' | xxd \-r \> file\fR
+\fI% echo "010000: 41" | xxd \-r > file\fR
 .PP
 .br
 Hexdump this file with autoskip.
@@ -293,7 +291,7 @@
 The number after '\-r \-s' adds to the linenumbers found in the file;
 in effect, the leading bytes are suppressed.
 .br
-\fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> file\fR
+\fI% echo "010000: 41" | xxd \-r \-s \-0x10000 > file\fR
 .PP
 Use xxd as a filter within an editor such as
 .B vim(1)
@@ -356,7 +354,7 @@
 .br
 (c) 1990-1997 by Juergen Weigert
 .br
-<jnweiger@informatik.uni-erlangen.de>
+<jnweiger@informatik.uni\-erlangen.de>
 .LP
 Distribute freely and credit me,
 .br

--ikeVEW9yuYc//A+q--