Module Name: src
Committed By: christos
Date: Sat Jun 30 21:31:15 UTC 2012
Modified Files:
src/usr.bin/fmt: fmt.1 fmt.c
Log Message:
add -w as an alias to -m
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/fmt/fmt.1
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/fmt/fmt.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/fmt/fmt.1
diff -u src/usr.bin/fmt/fmt.1:1.12 src/usr.bin/fmt/fmt.1:1.13
--- src/usr.bin/fmt/fmt.1:1.12 Tue Mar 10 16:23:47 2009
+++ src/usr.bin/fmt/fmt.1 Sat Jun 30 17:31:15 2012
@@ -1,4 +1,4 @@
-.\" $NetBSD: fmt.1,v 1.12 2009/03/10 20:23:47 joerg Exp $
+.\" $NetBSD: fmt.1,v 1.13 2012/06/30 21:31:15 christos Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)fmt.1 8.1 (Berkeley) 6/6/93
.\"
-.Dd May 29, 2007
+.Dd June 31, 2012
.Dt FMT 1
.Os
.Sh NAME
@@ -47,6 +47,7 @@
.Op Fl Cr
.Op Fl g Ar goal
.Op Fl m Ar maximum
+.Op Fl w Ar maximum
.Op name ...
.Sh DESCRIPTION
.Nm
@@ -75,6 +76,8 @@ to center the text.
New way to set the goal length.
.It Fl m Ar maximum
New way to set the maximum length.
+.It Fl w Ar maximum
+New way to set the maximum length.
.It Fl r
Raw mode; formats all lines and does not make exceptions for lines
that start with a period or look like mail headers.
Index: src/usr.bin/fmt/fmt.c
diff -u src/usr.bin/fmt/fmt.c:1.31 src/usr.bin/fmt/fmt.c:1.32
--- src/usr.bin/fmt/fmt.c:1.31 Mon Jul 21 10:19:22 2008
+++ src/usr.bin/fmt/fmt.c Sat Jun 30 17:31:15 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: fmt.c,v 1.31 2008/07/21 14:19:22 lukem Exp $ */
+/* $NetBSD: fmt.c,v 1.32 2012/06/30 21:31:15 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
#if 0
static char sccsid[] = "@(#)fmt.c 8.1 (Berkeley) 7/20/93";
#endif
-__RCSID("$NetBSD: fmt.c,v 1.31 2008/07/21 14:19:22 lukem Exp $");
+__RCSID("$NetBSD: fmt.c,v 1.32 2012/06/30 21:31:15 christos Exp $");
#endif /* not lint */
#include <ctype.h>
@@ -113,7 +113,7 @@ main(int argc, char **argv)
setprogname(*argv);
(void)setlocale(LC_ALL, "");
- while ((c = getopt(argc, argv, "Cg:m:r")) != -1)
+ while ((c = getopt(argc, argv, "Cg:m:rw:")) != -1)
switch (c) {
case 'C':
center++;
@@ -123,6 +123,7 @@ main(int argc, char **argv)
compat = 0;
break;
case 'm':
+ case 'w':
(void)getnum(optarg, "max", &max_length, 1);
compat = 0;
break;
@@ -175,7 +176,7 @@ static void
usage(void)
{
(void)fprintf(stderr,
- "Usage: %s [-Cr] [-g <goal>] [-m <max>] [<files>..]\n"
+ "Usage: %s [-Cr] [-g <goal>] [-m|w <max>] [<files>..]\n"
"\t %s [-Cr] [<goal>] [<max>] [<files>]\n",
getprogname(), getprogname());
exit(1);