Module Name: src
Committed By: abhinav
Date: Thu Jun 16 15:10:58 UTC 2016
Modified Files:
src/usr.bin/man: man.1 man.c
Log Message:
Document -f option for man(1).
Also remove unsupported options for `man -k` from the synopsis and usage.
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/man/man.1
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/man/man.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/man/man.1
diff -u src/usr.bin/man/man.1:1.28 src/usr.bin/man/man.1:1.29
--- src/usr.bin/man/man.1:1.28 Thu Aug 14 15:44:47 2014
+++ src/usr.bin/man/man.1 Thu Jun 16 15:10:58 2016
@@ -1,4 +1,4 @@
-.\" $NetBSD: man.1,v 1.28 2014/08/14 15:44:47 apb Exp $
+.\" $NetBSD: man.1,v 1.29 2016/06/16 15:10:58 abhinav Exp $
.\"
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)man.1 8.2 (Berkeley) 1/2/94
.\"
-.Dd August 14, 2014
+.Dd June 16, 2016
.Dt MAN 1
.Os
.Sh NAME
@@ -49,10 +49,12 @@
.Oc
.Ar name Ar ...
.Nm
-.Fl k
.Op Fl C Ar file
-.Op Fl M Ar path
-.Op Fl m Ar path
+.Fl f
+.Ar command Ar ...
+.Nm
+.Op Fl C Ar file
+.Fl k
.Ar keyword Ar ...
.Nm
.Fl p
@@ -82,6 +84,12 @@ Copy the man page to the standard output
.Xr more 1
to paginate it.
This is done by default if the standard output is not a terminal device.
+.It Fl f
+Synonym for
+.Xr whatis 1 .
+It searches man pages for
+.Ar command
+in their names and displays header lines from all matching pages.
.It Fl h
Display only the
.Dq Tn SYNOPSIS
@@ -90,7 +98,7 @@ For commands, this is typically the comm
For library functions, this usually contains the required include
files and function prototypes.
.It Fl k
-Display the header lines for any man pages matching
+Search man pages for
.Ar keyword Ns Pq s ,
in the same manner as
.Xr apropos 1 .
Index: src/usr.bin/man/man.c
diff -u src/usr.bin/man/man.c:1.63 src/usr.bin/man/man.c:1.64
--- src/usr.bin/man/man.c:1.63 Sat May 21 17:21:40 2016
+++ src/usr.bin/man/man.c Thu Jun 16 15:10:58 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: man.c,v 1.63 2016/05/21 17:21:40 abhinav Exp $ */
+/* $NetBSD: man.c,v 1.64 2016/06/16 15:10:58 abhinav Exp $ */
/*
* Copyright (c) 1987, 1993, 1994, 1995
@@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
#if 0
static char sccsid[] = "@(#)man.c 8.17 (Berkeley) 1/31/95";
#else
-__RCSID("$NetBSD: man.c,v 1.63 2016/05/21 17:21:40 abhinav Exp $");
+__RCSID("$NetBSD: man.c,v 1.64 2016/06/16 15:10:58 abhinav Exp $");
#endif
#endif /* not lint */
@@ -1031,8 +1031,9 @@ usage(void)
{
(void)fprintf(stderr, "Usage: %s [-acw|-h] [-C cfg] [-M path] "
"[-m path] [-S srch] [[-s] sect] name ...\n", getprogname());
+ (void)fprintf(stderr, "Usage: %s [-C file] -f command ...\n", getprogname());
(void)fprintf(stderr,
- "Usage: %s -k [-C cfg] [-M path] [-m path] keyword ...\n",
+ "Usage: %s [-C file] -k keyword ...\n",
getprogname());
(void)fprintf(stderr, "Usage: %s -p\n", getprogname());
exit(EXIT_FAILURE);