Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/m4 Get first getopt string right; provide better usa...
details: https://anonhg.NetBSD.org/src/rev/f1e3f500d432
branches: trunk
changeset: 517533:f1e3f500d432
user: tv <tv%NetBSD.org@localhost>
date: Wed Nov 14 14:57:04 2001 +0000
description:
Get first getopt string right; provide better usage message.
diffstat:
usr.bin/m4/extern.h | 4 ++--
usr.bin/m4/main.c | 8 ++++----
usr.bin/m4/misc.c | 10 ++++++----
3 files changed, 12 insertions(+), 10 deletions(-)
diffs (86 lines):
diff -r 0de47a1e53e0 -r f1e3f500d432 usr.bin/m4/extern.h
--- a/usr.bin/m4/extern.h Wed Nov 14 14:49:38 2001 +0000
+++ b/usr.bin/m4/extern.h Wed Nov 14 14:57:04 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.7 2001/11/14 06:16:08 tv Exp $ */
+/* $NetBSD: extern.h,v 1.8 2001/11/14 14:57:04 tv Exp $ */
/* $OpenBSD: extern.h,v 1.28 2001/10/10 18:12:00 espie Exp $ */
/*-
@@ -86,7 +86,7 @@
extern void putback __P((int));
extern void *xalloc __P((size_t));
extern char *xstrdup __P((const char *));
-extern void usage __P((void));
+extern void usage __P((const char *));
extern void resizedivs __P((int));
extern size_t buffer_mark __P((void));
extern void dump_buffer __P((FILE *, size_t));
diff -r 0de47a1e53e0 -r f1e3f500d432 usr.bin/m4/main.c
--- a/usr.bin/m4/main.c Wed Nov 14 14:49:38 2001 +0000
+++ b/usr.bin/m4/main.c Wed Nov 14 14:57:04 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.27 2001/11/14 06:16:09 tv Exp $ */
+/* $NetBSD: main.c,v 1.28 2001/11/14 14:57:04 tv Exp $ */
/* $OpenBSD: main.c,v 1.51 2001/10/06 10:52:25 espie Exp $ */
/*-
@@ -47,7 +47,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: main.c,v 1.27 2001/11/14 06:16:09 tv Exp $");
+__RCSID("$NetBSD: main.c,v 1.28 2001/11/14 14:57:04 tv Exp $");
#endif
#endif /* not lint */
@@ -186,7 +186,7 @@
/*
* We need to know if -P is there before checking -D and -U.
*/
- while ((c = getopt(argc, argv, "tPD:U:")) != -1)
+ while ((c = getopt(argc, argv, "D:I:PU:d:go:t:")) != -1)
if (c == 'P')
m4prefix = 1;
optind = 1;
@@ -234,7 +234,7 @@
break;
case '?':
default:
- usage();
+ usage(argv[0]);
}
argc -= optind;
diff -r 0de47a1e53e0 -r f1e3f500d432 usr.bin/m4/misc.c
--- a/usr.bin/m4/misc.c Wed Nov 14 14:49:38 2001 +0000
+++ b/usr.bin/m4/misc.c Wed Nov 14 14:57:04 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.12 2001/11/14 06:16:09 tv Exp $ */
+/* $NetBSD: misc.c,v 1.13 2001/11/14 14:57:04 tv Exp $ */
/* $OpenBSD: misc.c,v 1.25 2001/10/10 11:17:37 espie Exp $ */
/*
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: misc.c,v 1.12 2001/11/14 06:16:09 tv Exp $");
+__RCSID("$NetBSD: misc.c,v 1.13 2001/11/14 14:57:04 tv Exp $");
#endif
#endif /* not lint */
@@ -298,9 +298,11 @@
}
void
-usage()
+usage(progname)
+ const char *progname;
{
- fprintf(stderr, "usage: m4 [-P] [-Dname[=val]] [-Uname] [-I dirname...]\n");
+ fprintf(stderr, "usage: %s [-Pg] [-Dname[=val]] [-I dirname] [-Uname]\n", progname);
+ fprintf(stderr, "\t[-d flags] [-o trfile] [-t macro]\n");
exit(1);
}
Home |
Main Index |
Thread Index |
Old Index