summaryrefslogtreecommitdiff
path: root/usr.bin/vis/vis.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2014-09-26 01:21:07 +0000
committerchristos <christos@NetBSD.org>2014-09-26 01:21:07 +0000
commit2e73bb3f331088d6eacb1d50bb44121c7adbb9ef (patch)
tree41689dea33209a34907c3600b2dc8c8e654ca69d /usr.bin/vis/vis.c
parent911916a201b9a21fb3a9d9b4c346286adcb2953d (diff)
add VIS_META/VIS_SHELL support to encode all shell metacharacters.
XXX: /etc/rc.d/wizd fix $
Diffstat (limited to 'usr.bin/vis/vis.c')
-rw-r--r--usr.bin/vis/vis.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/vis/vis.c b/usr.bin/vis/vis.c
index 1509c81c412..f359dbf962e 100644
--- a/usr.bin/vis/vis.c
+++ b/usr.bin/vis/vis.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vis.c,v 1.22 2013/02/20 17:04:45 christos Exp $ */
+/* $NetBSD: vis.c,v 1.23 2014/09/26 01:21:07 christos Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\
#if 0
static char sccsid[] = "@(#)vis.c 8.1 (Berkeley) 6/6/93";
#endif
-__RCSID("$NetBSD: vis.c,v 1.22 2013/02/20 17:04:45 christos Exp $");
+__RCSID("$NetBSD: vis.c,v 1.23 2014/09/26 01:21:07 christos Exp $");
#endif /* not lint */
#include <stdio.h>
@@ -70,7 +70,7 @@ main(int argc, char *argv[])
int ch;
int rval;
- while ((ch = getopt(argc, argv, "bcde:F:fhlmnostw")) != -1)
+ while ((ch = getopt(argc, argv, "bcde:F:fhlmMnosStw")) != -1)
switch((char)ch) {
case 'b':
eflags |= VIS_NOSLASH;
@@ -107,6 +107,9 @@ main(int argc, char *argv[])
if (foldwidth == 80)
foldwidth = 76;
break;
+ case 'M':
+ eflags |= VIS_META;
+ break;
case 'n':
none++;
break;
@@ -116,6 +119,9 @@ main(int argc, char *argv[])
case 's':
eflags |= VIS_SAFE;
break;
+ case 'S':
+ eflags |= VIS_SHELL;
+ break;
case 't':
eflags |= VIS_TAB;
break;
@@ -125,7 +131,7 @@ main(int argc, char *argv[])
case '?':
default:
(void)fprintf(stderr,
- "Usage: %s [-bcfhlmnostw] [-e extra]"
+ "Usage: %s [-bcfhlmMnosStw] [-e extra]"
" [-F foldwidth] [file ...]\n", getprogname());
return 1;
}