summaryrefslogtreecommitdiff
path: root/usr.bin
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
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')
-rw-r--r--usr.bin/mandoc/apropos.c24
-rw-r--r--usr.bin/mandoc/whatis.129
2 files changed, 29 insertions, 24 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);
-}
diff --git a/usr.bin/mandoc/whatis.1 b/usr.bin/mandoc/whatis.1
index ee107d73280..9b0acffa5e6 100644
--- a/usr.bin/mandoc/whatis.1
+++ b/usr.bin/mandoc/whatis.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: whatis.1,v 1.3 2012/01/01 17:44:44 schwarze Exp $
+.\" $OpenBSD: whatis.1,v 1.4 2012/01/05 22:07:42 schwarze Exp $
.\"
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)whatis.1 8.1 (Berkeley) 6/6/93
.\"
-.Dd $Mdocdate: January 1 2012 $
+.Dd $Mdocdate: January 5 2012 $
.Dt WHATIS 1
.Os
.Sh NAME
@@ -42,21 +42,27 @@
.Op Fl m Ar path
.Op Fl S Ar arch
.Op Fl s Ar section
-.Ar command ...
+.Ar name ...
.Sh DESCRIPTION
+The
.Nm
-looks up a given command and gives the header line from the manual page.
+utility looks up the given commands and shows the header lines
+from the manual pages.
You can then use the
.Xr man 1
command to get more information.
.Nm
-will match on a case insensitive basis and for multiple word entries
+will match manual page
+.Ar names
+on a case insensitive basis and for multiple word entries
will match on each individual word.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl C Ar file
-Specify an alternate configuration file in
+Specify an alternate configuration
+.Ar file
+in
.Xr man.conf 5
format.
The default is
@@ -143,6 +149,12 @@ configuration file
.Xr man.conf 5 ,
.Xr makewhatis 8
.Sh HISTORY
+Part of the functionality of
+.Nm
+was already provided by the former
+.Nm manwhere
+utility in
+.Bx 1 .
The
.Nm
command first appeared in
@@ -173,7 +185,10 @@ in
.Sh AUTHORS
.An -nosplit
.An Bill Joy
-wrote the original
+wrote
+.Nm manwhere
+in 1977
+and the original
.Bx
.Nm
in 1979.