]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: improve od --help and man page
authorPádraig Brady <P@draigBrady.com>
Thu, 27 Dec 2012 04:14:14 +0000 (04:14 +0000)
committerPádraig Brady <P@draigBrady.com>
Thu, 27 Dec 2012 13:42:07 +0000 (13:42 +0000)
* src/od.c: Redorder the information output by --help
to ease interpretation and so that appropriate sections
are generated by help2man.
* doc/coreutils.texi (od invocation): Fix an incorrect
reference to @var{n}, which should be @var{bytes}.
* man/od.x: Add an "Examples" section, and move the
default od format to there, and add a commonly required
format to generate hexdumps.
Reported by Akim Demaille in http://bugs.gnu.org/13280.

doc/coreutils.texi
man/od.x
src/od.c

index bed35536434bc7a331565fd17764fe251992040a..3c970d72d2c487e5681b10029820aa45a5b2a3ae 100644 (file)
@@ -1884,7 +1884,7 @@ followed by a zero byte (ASCII @sc{nul}).
 Prefixes and suffixes on @var{bytes} are interpreted as for the
 @option{-j} option.
 
-If @var{n} is omitted with @option{--strings}, the default is 3.
+If @var{bytes} is omitted with @option{--strings}, the default is 3.
 
 @item -t @var{type}
 @itemx --format=@var{type}
index c913f8046f1cfe6641b730516be860bd60008f61..b98beec431eaca498721f2893e7f1ce8b249a9a7 100644 (file)
--- a/man/od.x
+++ b/man/od.x
@@ -2,3 +2,10 @@
 od \- dump files in octal and other formats
 [DESCRIPTION]
 .\" Add any additional description here
+[EXAMPLES]
+.TP
+.B od -A x -t x1z -v
+Display hexdump format output
+.TP
+.B od -A o -t oS -w 16
+The default output format used by od
index a25f965016a5c1bad64ad6d3d60c2b4ee1bfbf80..e94d369aabdce0f5b5e1f82b283c50eb21c5f0c1 100644 (file)
--- a/src/od.c
+++ b/src/od.c
@@ -305,24 +305,38 @@ With no FILE, or when FILE is -, read standard input.\n\
 \n\
 "), stdout);
       fputs (_("\
-All arguments to long options are mandatory for short options.\n\
+If first and second call formats both apply, the second format is assumed\n\
+if the last operand begins with + or (if there are 2 operands) a digit.\n\
+An OFFSET operand means -j OFFSET.  LABEL is the pseudo-address\n\
+at first byte printed, incremented when dump is progressing.\n\
+For OFFSET and LABEL, a 0x or 0X prefix indicates hexadecimal;\n\
+suffixes may be . for octal and b for multiply by 512.\n\
+\n\
+"), stdout);
+      fputs (_("\
+Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
       fputs (_("\
-  -A, --address-radix=RADIX   decide how file offsets are printed\n\
+  -A, --address-radix=RADIX   output format for file offsets.  RADIX is one\n\
+                                of [doxn], for Decimal, Octal, Hex or None\n\
   -j, --skip-bytes=BYTES      skip BYTES input bytes first\n\
 "), stdout);
       fputs (_("\
   -N, --read-bytes=BYTES      limit dump to BYTES input bytes\n\
-  -S BYTES, --strings[=BYTES]  output strings of at least BYTES graphic chars\n\
+  -S BYTES, --strings[=BYTES]  output strings of at least BYTES graphic chars.\
+\n\
+                                3 is implied when BYTES is not specified\n\
   -t, --format=TYPE           select output format or formats\n\
   -v, --output-duplicates     do not use * to mark line suppression\n\
-  -w[BYTES], --width[=BYTES]  output BYTES bytes per output line\n\
-      --traditional           accept arguments in traditional form\n\
+  -w[BYTES], --width[=BYTES]  output BYTES bytes per output line.\n\
+                                32 is implied when BYTES is not specified\n\
+      --traditional           accept arguments in third form above\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
       fputs (_("\
 \n\
+\n\
 Traditional format specifications may be intermixed; they accumulate:\n\
   -a   same as -t a,  select named characters, ignoring high-order bit\n\
   -b   same as -t o1, select octal bytes\n\
@@ -339,17 +353,8 @@ Traditional format specifications may be intermixed; they accumulate:\n\
 "), stdout);
       fputs (_("\
 \n\
-If first and second call formats both apply, the second format is assumed\n\
-if the last operand begins with + or (if there are 2 operands) a digit.\n\
-An OFFSET operand means -j OFFSET.  LABEL is the pseudo-address\n\
-at first byte printed, incremented when dump is progressing.\n\
-For OFFSET and LABEL, a 0x or 0X prefix indicates hexadecimal;\n\
-suffixes may be . for octal and b for multiply by 512.\n\
-"), stdout);
-      fputs (_("\
 \n\
 TYPE is made up of one or more of these specifications:\n\
-\n\
   a          named character, ignoring high-order bit\n\
   c          ASCII character or backslash escape\n\
 "), stdout);
@@ -362,24 +367,26 @@ TYPE is made up of one or more of these specifications:\n\
 "), stdout);
       fputs (_("\
 \n\
-SIZE is a number.  For TYPE in doux, SIZE may also be C for\n\
+SIZE is a number.  For TYPE in [doux], SIZE may also be C for\n\
 sizeof(char), S for sizeof(short), I for sizeof(int) or L for\n\
 sizeof(long).  If TYPE is f, SIZE may also be F for sizeof(float), D\n\
 for sizeof(double) or L for sizeof(long double).\n\
 "), stdout);
       fputs (_("\
 \n\
-RADIX is d for decimal, o for octal, x for hexadecimal or n for none.\n\
-BYTES is hexadecimal with 0x or 0X prefix, and may have a multiplier suffix:\n\
-b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\
-GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\
-Adding a z suffix to any type displays printable characters at the end of each\
-\n\
-output line.\n\
+Adding a z suffix to any type displays printable characters at the end of\n\
+each output line.\n\
 "), stdout);
       fputs (_("\
-Option --string without a number implies 3; option --width without a number\n\
-implies 32.  By default, od uses -A o -t oS -w16.\n\
+\n\
+\n\
+BYTES is hex with 0x or 0X prefix, and may have a multiplier suffix:\n\
+  b    512\n\
+  KB   1000\n\
+  K    1024\n\
+  MB   1000*1000\n\
+  M    1024*1024\n\
+and so on for G, T, P, E, Z, Y.\n\
 "), stdout);
       emit_ancillary_info ();
     }