summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2010-08-21 19:00:51 +0000
committerDamien Miller <djm@cvs.openbsd.org>2010-08-21 19:00:51 +0000
commit5044f1e98f79891c7f32b935aa073a751116b7fc (patch)
tree767208587d02fd45df1f4ea51f48ca9fdca4ff59
parent20b28aebdc9d72f6cff9b47e4a228afbd3d67834 (diff)
mirror new flags to vis(3): -a to encode all characters, -h to use
hex encoding. feedback jmc@ ok millert@
-rw-r--r--usr.bin/vis/vis.111
-rw-r--r--usr.bin/vis/vis.c12
2 files changed, 17 insertions, 6 deletions
diff --git a/usr.bin/vis/vis.1 b/usr.bin/vis/vis.1
index cd1d2192b20..9a0f223957e 100644
--- a/usr.bin/vis/vis.1
+++ b/usr.bin/vis/vis.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: vis.1,v 1.13 2009/08/16 09:41:08 sobrado Exp $
+.\" $OpenBSD: vis.1,v 1.14 2010/08/21 19:00:50 djm Exp $
.\" $NetBSD: vis.1,v 1.5 1994/11/17 07:56:00 jtc Exp $
.\"
.\" Copyright (c) 1989, 1991, 1993, 1994
@@ -30,7 +30,7 @@
.\"
.\" @(#)vis.1 8.4 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: August 16 2009 $
+.Dd $Mdocdate: August 21 2010 $
.Dt VIS 1
.Os
.Sh NAME
@@ -38,7 +38,7 @@
.Nd display non-printable characters in a visual format
.Sh SYNOPSIS
.Nm vis
-.Op Fl bcflnostw
+.Op Fl abcfhlnostw
.Op Fl F Ar foldwidth
.Op Ar
.Sh DESCRIPTION
@@ -59,6 +59,8 @@ various visual formats is given in
.Pp
The options are as follows:
.Bl -tag -width Ds
+.It Fl a
+Encode all characters, whether originally visible or not.
.It Fl b
Turns off prepending of backslash before up-arrow control sequences
and meta-characters, and disables the doubling of backslashes.
@@ -89,6 +91,9 @@ typically don't work with partial lines.
Like
.Fl F ,
except output is always folded to 80 columns.
+.It Fl h
+Request a format which displays non-printable characters as
+a hexadecimal number, \exdd.
.It Fl l
Mark newlines with the visible sequence
.Ql \e$ ,
diff --git a/usr.bin/vis/vis.c b/usr.bin/vis/vis.c
index e6ad55f64a4..e5c11265985 100644
--- a/usr.bin/vis/vis.c
+++ b/usr.bin/vis/vis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vis.c,v 1.12 2009/10/27 23:59:49 deraadt Exp $ */
+/* $OpenBSD: vis.c,v 1.13 2010/08/21 19:00:50 djm Exp $ */
/* $NetBSD: vis.c,v 1.4 1994/12/20 16:13:03 jtc Exp $ */
/*-
@@ -53,8 +53,11 @@ main(int argc, char *argv[])
FILE *fp;
int ch;
- while ((ch = getopt(argc, argv, "nwctsobfF:ld")) != -1)
+ while ((ch = getopt(argc, argv, "anwctshobfF:ld")) != -1)
switch((char)ch) {
+ case 'a':
+ eflags |= VIS_ALL;
+ break;
case 'n':
none++;
break;
@@ -70,6 +73,9 @@ main(int argc, char *argv[])
case 's':
eflags |= VIS_SAFE;
break;
+ case 'h':
+ eflags |= VIS_HEX;
+ break;
case 'o':
eflags |= VIS_OCTAL;
break;
@@ -169,7 +175,7 @@ usage(void)
{
extern char *__progname;
- fprintf(stderr, "usage: %s [-bcflnostw] [-F foldwidth] [file ...]\n",
+ fprintf(stderr, "usage: %s [-abcfhlnostw] [-F foldwidth] [file ...]\n",
__progname);
exit(1);
}