summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2006-01-23 17:08:46 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2006-01-23 17:08:46 +0000
commit9ddfa170a43b51701a0cc80ef3067472484d9603 (patch)
tree72a578290e8a6c42933b07731d5dc8534eecc80a /usr.bin
parent2410bfeea1b3e60ecae8a72b86ed9e23461920cc (diff)
display usage if an unknown option is specified;
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/rcs/rlog.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/usr.bin/rcs/rlog.c b/usr.bin/rcs/rlog.c
index a9d4e28cd35..b34444d6c37 100644
--- a/usr.bin/rcs/rlog.c
+++ b/usr.bin/rcs/rlog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rlog.c,v 1.20 2006/01/23 17:02:59 xsa Exp $ */
+/* $OpenBSD: rlog.c,v 1.21 2006/01/23 17:08:45 xsa Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -42,6 +42,14 @@ static int hflag, Lflag, tflag, Nflag, wflag;
static char *slist = NULL;
static char *wlist = NULL;
+void
+rlog_usage(void)
+{
+ fprintf(stderr,
+ "usage: rlog [-hLNqRTtV] [-sstates] [-w[logins]] "
+ "[-xsuffixes] file ...\n");
+}
+
int
rlog_main(int argc, char **argv)
{
@@ -90,7 +98,8 @@ rlog_main(int argc, char **argv)
rcs_suffixes = rcs_optarg;
break;
default:
- break;
+ (usage());
+ exit(1);
}
}
@@ -134,14 +143,6 @@ rlog_main(int argc, char **argv)
return (0);
}
-void
-rlog_usage(void)
-{
- fprintf(stderr,
- "usage: rlog [-hLNqRTtV] [-sstates] [-w[logins]] "
- "[-xsuffixes] file ...\n");
-}
-
static int
rlog_file(const char *fname, const char *fpath, RCSFILE *file)
{