Added -C option for hexadecimal+ASCII display. [PR/5017]

Fixed minor inconsistency in option descriptions in the man page.
This commit is contained in:
jeremy 1998-02-20 23:45:27 +00:00
parent 4abf2e5151
commit 757abd14c5
2 changed files with 18 additions and 8 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: hexdump.1,v 1.8 1997/10/19 02:34:05 lukem Exp $
.\" $NetBSD: hexdump.1,v 1.9 1998/02/20 23:45:27 jeremy Exp $
.\"
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@ -41,7 +41,7 @@
.Nd ascii, decimal, hexadecimal, octal dump
.Sh SYNOPSIS
.Nm
.Op Fl bcdovx
.Op Fl bcCdovx
.Op Fl e Ar format_string
.Op Fl f Ar format_file
.Op Fl n Ar length
@ -66,8 +66,13 @@ in octal, per line.
Display the input offset in hexadecimal, followed by sixteen
space-separated, three column, space-filled, characters of input
data per line.
.It Fl C
.Em Canonical hex+ASCII display .
Display the input offset in hexadecimal, followed by sixteen
space-separated, two column, hexadecimal bytes, followed by the
same sixteen bytes in %_p format enclosed in ``|'' characters.
.It Fl d
.Em Two-byte decimal display.
.Em Two-byte decimal display .
Display the input offset in hexadecimal, followed by eight
space-separated, five column, zero-filled, two-byte units
of input data, in unsigned decimal, per line.
@ -83,7 +88,7 @@ Interpret only
.Ar length
bytes of input.
.It Fl o
.Em Two-byte octal display.
.Em Two-byte octal display .
Display the input offset in hexadecimal, followed by eight
space-separated, six column, zero-filled, two byte quantities of
input data, in octal, per line.
@ -128,7 +133,7 @@ identical to the immediately preceding group of output lines (except
for the input offsets), are replaced with a line comprised of a
single asterisk.
.It Fl x
.Em Two-byte hexadecimal display.
.Em Two-byte hexadecimal display .
Display the input offset in hexadecimal, followed by eight, space
separated, four column, zero-filled, two-byte quantities of input
data, in hexadecimal, per line.

View File

@ -1,4 +1,4 @@
/* $NetBSD: hexsyntax.c,v 1.6 1997/10/19 02:34:07 lukem Exp $ */
/* $NetBSD: hexsyntax.c,v 1.7 1998/02/20 23:45:27 jeremy Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)hexsyntax.c 8.2 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: hexsyntax.c,v 1.6 1997/10/19 02:34:07 lukem Exp $");
__RCSID("$NetBSD: hexsyntax.c,v 1.7 1998/02/20 23:45:27 jeremy Exp $");
#endif
#endif /* not lint */
@ -63,7 +63,7 @@ newsyntax(argc, argvp)
char *p, **argv;
argv = *argvp;
while ((ch = getopt(argc, argv, "bcde:f:n:os:vx")) != -1)
while ((ch = getopt(argc, argv, "bcCde:f:n:os:vx")) != -1)
switch (ch) {
case 'b':
add("\"%07.7_Ax\n\"");
@ -73,6 +73,11 @@ newsyntax(argc, argvp)
add("\"%07.7_Ax\n\"");
add("\"%07.7_ax \" 16/1 \"%3_c \" \"\\n\"");
break;
case 'C':
add("\"%08.8_Ax\n\"");
add("\"%08.8_ax \" 8/1 \"%02x \" \" \" 8/1 \"%02x \" ");
add("\" |\" 16/1 \"%_p\" \"|\\n\"");
break;
case 'd':
add("\"%07.7_Ax\n\"");
add("\"%07.7_ax \" 8/2 \" %05u \" \"\\n\"");