summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/apropos.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2012-01-05 22:07:43 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2012-01-05 22:07:43 +0000
commit93d6361bea1c6db56c6de30732606fed1e895c8b (patch)
tree32206e38e16a1732b49c71840af5ca8880e51a89 /usr.bin/mandoc/apropos.c
parente7734894cb54fea075311bd05348f9d256f45d95 (diff)
Small tweaks for precision; lots of feedback from jmc@.
Update usage() as well; reminded by jmc@. Mention the manwhere(1) predecessor in 1BSD; suggested by kristaps@. OK jmc@.
Diffstat (limited to 'usr.bin/mandoc/apropos.c')
-rw-r--r--usr.bin/mandoc/apropos.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/usr.bin/mandoc/apropos.c b/usr.bin/mandoc/apropos.c
index 4b2e49719fd..ef50a78e731 100644
--- a/usr.bin/mandoc/apropos.c
+++ b/usr.bin/mandoc/apropos.c
@@ -1,4 +1,4 @@
-/* $Id: apropos.c,v 1.14 2011/12/28 01:17:01 schwarze Exp $ */
+/* $Id: apropos.c,v 1.15 2012/01/05 22:07:42 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -27,7 +27,6 @@
static int cmp(const void *, const void *);
static void list(struct res *, size_t, void *);
-static void usage(void);
static char *progname;
@@ -77,7 +76,12 @@ apropos(int argc, char *argv[])
opts.cat = optarg;
break;
default:
- usage();
+ fprintf(stderr,
+ "usage: %s [-C file] [-M path] [-m path]"
+ " [-S arch] [-s section]%s ...\n",
+ progname,
+ whatis ? " name" :
+ "\n expression");
return(EXIT_FAILURE);
}
@@ -137,17 +141,3 @@ cmp(const void *p1, const void *p2)
return(strcasecmp(((const struct res *)p1)->title,
((const struct res *)p2)->title));
}
-
-static void
-usage(void)
-{
-
- fprintf(stderr, "usage: %s "
- "[-C file] "
- "[-M path] "
- "[-m path] "
- "[-S arch] "
- "[-s section] "
- "expression ...\n",
- progname);
-}