Module Name:    src
Committed By:   christos
Date:           Sun May 24 19:42:39 UTC 2015

Modified Files:
        src/usr.bin/vis: vis.1 vis.c

Log Message:
Add -N (VIS_NOLOCALE), sort.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/vis/vis.1
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/vis/vis.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/vis/vis.1
diff -u src/usr.bin/vis/vis.1:1.22 src/usr.bin/vis/vis.1:1.23
--- src/usr.bin/vis/vis.1:1.22	Thu Sep 25 22:20:39 2014
+++ src/usr.bin/vis/vis.1	Sun May 24 15:42:39 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vis.1,v 1.22 2014/09/26 02:20:39 wiz Exp $
+.\"	$NetBSD: vis.1,v 1.23 2015/05/24 19:42:39 christos Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"     @(#)vis.1	8.4 (Berkeley) 4/19/94
 .\"
-.Dd September 25, 2014
+.Dd May 24, 2015
 .Dt VIS 1
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd display non-printable characters in a visual format
 .Sh SYNOPSIS
 .Nm
-.Op Fl bcfhlMmnoSstw
+.Op Fl bcfhlMmNnoSstw
 .Op Fl e Ar extra
 .Op Fl F Ar foldwidth
 .Op Ar file ...
@@ -99,15 +99,22 @@ Encode using the URI encoding from RFC 1
 Mark newlines with the visible sequence
 .Ql \e$ ,
 followed by the newline.
-.It Fl m
-Encode using the MIME Quoted-Printable encoding from RFC 2045.
-.Pq Dv VIS_MIMESTYLE
 .It Fl M
 Encode all shell meta characters (implies
 .Fl S ,
 .Fl w ,
 .Fl g )
 .Pq Dv VIS_META
+.It Fl m
+Encode using the MIME Quoted-Printable encoding from RFC 2045.
+.Pq Dv VIS_MIMESTYLE
+.It Fl N
+Turn on the
+.Dv VIS_NOLOCALE
+flag which encodes using the
+.Dq C
+locale, removing any encoding dependencies caused by the current
+locale settings specified in the environment.
 .It Fl n
 Turns off any encoding, except for the fact that backslashes are
 still doubled and hidden newline sequences inserted if
@@ -129,14 +136,14 @@ That is, the output can be unfolded by r
 Request a format which displays non-printable characters as
 an octal number, \eddd.
 .Pq Dv VIS_OCTAL
+.It Fl S
+Encode shell meta-characters that are non-white space or glob.
+.Pq Dv VIS_SHELL
 .It Fl s
 Only characters considered unsafe to send to a terminal are encoded.
 This flag allows backspace, bell, and carriage return in addition
 to the default space, tab and newline.
 .Pq Dv VIS_SAFE
-.It Fl S
-Encode shell meta-characters that are non-white space or glob.
-.Pq Dv VIS_SHELL
 .It Fl t
 Tabs are also encoded.
 .Pq Dv VIS_TAB

Index: src/usr.bin/vis/vis.c
diff -u src/usr.bin/vis/vis.c:1.24 src/usr.bin/vis/vis.c:1.25
--- src/usr.bin/vis/vis.c:1.24	Thu Sep 25 22:20:39 2014
+++ src/usr.bin/vis/vis.c	Sun May 24 15:42:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vis.c,v 1.24 2014/09/26 02:20:39 wiz Exp $	*/
+/*	$NetBSD: vis.c,v 1.25 2015/05/24 19:42:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)vis.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: vis.c,v 1.24 2014/09/26 02:20:39 wiz Exp $");
+__RCSID("$NetBSD: vis.c,v 1.25 2015/05/24 19:42:39 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:fhlMmnoSstw")) != -1)
+	while ((ch = getopt(argc, argv, "bcde:F:fhlMmNnoSstw")) != -1)
 		switch((char)ch) {
 		case 'b':
 			eflags |= VIS_NOSLASH;
@@ -102,13 +102,16 @@ main(int argc, char *argv[])
 		case 'l':
 			markeol++;	/* mark end of line with \$ */
 			break;
+		case 'M':
+			eflags |= VIS_META;
+			break;
 		case 'm':
 			eflags |= VIS_MIMESTYLE;
 			if (foldwidth == 80)
 				foldwidth = 76;
 			break;
-		case 'M':
-			eflags |= VIS_META;
+		case 'N':
+			eflags |= VIS_NOLOCALE;
 			break;
 		case 'n':
 			none++;
@@ -116,12 +119,12 @@ main(int argc, char *argv[])
 		case 'o':
 			eflags |= VIS_OCTAL;
 			break;
-		case 's':
-			eflags |= VIS_SAFE;
-			break;
 		case 'S':
 			eflags |= VIS_SHELL;
 			break;
+		case 's':
+			eflags |= VIS_SAFE;
+			break;
 		case 't':
 			eflags |= VIS_TAB;
 			break;
@@ -131,7 +134,7 @@ main(int argc, char *argv[])
 		case '?':
 		default:
 			(void)fprintf(stderr, 
-			    "Usage: %s [-bcfhlMmnoSstw] [-e extra]" 
+			    "Usage: %s [-bcfhlMmNnoSstw] [-e extra]" 
 			    " [-F foldwidth] [file ...]\n", getprogname());
 			return 1;
 		}

Reply via email to