diff options
author | Jason McIntyre <jmc@cvs.openbsd.org> | 2004-02-23 14:14:15 +0000 |
---|---|---|
committer | Jason McIntyre <jmc@cvs.openbsd.org> | 2004-02-23 14:14:15 +0000 |
commit | dd9a31e57cffd0e38bee431e38b40422021c5f86 (patch) | |
tree | 045a5464bea03d0039cd1d265bae2aa3ea705115 /usr.bin/man | |
parent | 5dc743985a9b420f82443c633525ea24c143daef (diff) |
- mark up punctuation
- use more suitable macros where necessary
- a little grammar
- sort options and sync usage() (last part checked by henning)
Diffstat (limited to 'usr.bin/man')
-rw-r--r-- | usr.bin/man/man.1 | 100 | ||||
-rw-r--r-- | usr.bin/man/man.c | 9 | ||||
-rw-r--r-- | usr.bin/man/man.conf.5 | 104 |
3 files changed, 123 insertions, 90 deletions
diff --git a/usr.bin/man/man.1 b/usr.bin/man/man.1 index 99e035d06e4..52421d3ce51 100644 --- a/usr.bin/man/man.1 +++ b/usr.bin/man/man.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: man.1,v 1.20 2003/12/16 18:58:46 millert Exp $ +.\" $OpenBSD: man.1,v 1.21 2004/02/23 14:14:14 jmc Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -41,14 +41,14 @@ .Op Fl C Ar file .Op Fl M Ar path .Op Fl m Ar path -.Op Fl s Ar section .Op Fl S Ar subsection +.Op Fl s Ar section .Op Ar section .Ar name Op Ar ... .Nm man -.Fl k Ar keyword +.Fl f Ar command .Nm man -.Fl f Ar filename +.Fl k Ar keyword .Sh DESCRIPTION The .Nm @@ -60,23 +60,53 @@ manual pages entitled .Pp The options are as follows: .Bl -tag -width Ds -.It Fl k +.It Fl a +Display all of the manual pages for a specified +.Ar section +and +.Ar name +combination. +(Normally, only the first manual page found is displayed.) +.It Fl C Ar file +Use the specified +.Ar file +instead of the default configuration file. +This permits users to configure their own manual environment. +See +.Xr man.conf 5 +for a description of the contents of this file. +.It Fl c +Copy the manual page to the standard output instead of using +.Xr more 1 +to paginate it. +This is done by default if the standard output is not a terminal device. +.It Fl f Ar command +Locate man pages matching the +.Ar command +in much the same way +.Xr whatis 1 +works. +.It Fl h +Display only the +.Dq SYNOPSIS +lines of the requested manual pages. +.It Fl k Ar keyword Locate man pages matching .Ar keyword in much the same way as .Xr apropos 1 works (in fact, it runs -.Xr apropos 1 -for you). +.Xr apropos 1 ) . This can be used to find which man page applies to a particular subsystem -you are interested in, for instance +you are interested in. +For instance: .Pp -.Nm man Fl k Em mount +.Dl $ man -k mount .Pp -will list all man pages which contain your +will list all man pages which contain .Ar keyword in the -.Em NAME +.Dq NAME line of the man page; in this case a list much like this: .Bd -literal @@ -99,30 +129,6 @@ newfs, mount_mfs (8) \- construct a new file system umount (8) \- unmount file systems \&... .Ed -.It Fl a -Display all of the manual pages for a specified -.Ar section -and -.Ar name -combination. -(Normally, only the first manual page found is displayed.) -.It Fl C Ar file -Use the specified -.Ar file -instead of the default configuration file. -This permits users to configure their own manual environment. -See -.Xr man.conf 5 -for a description of the contents of this file. -.It Fl c -Copy the manual page to the standard output instead of using -.Xr more 1 -to paginate it. -This is done by default if the standard output is not a terminal device. -.It Fl h -Display only the -.Dq Tn SYNOPSIS -lines of the requested manual pages. .It Fl M Ar path Override the list of standard directories which .Nm @@ -135,7 +141,7 @@ separated list of directories. This search path may also be set using the environment variable .Ev MANPATH . The subdirectories to be searched, and their search order, -is specified by the +are specified by the .Dq _subdir line in the .Nm @@ -156,15 +162,11 @@ option or the .Ev MANPATH environment variable. The subdirectories to be searched, and their search order, -is specified by the +are specified by the .Dq _subdir line in the .Nm configuration file. -.It Fl s Ar section -Another way of specifying the section, for compatibility with -.Nm -on other operating systems. .It Fl S Ar subsection Specifies the machine-dependent subsection. This overrides the @@ -173,6 +175,10 @@ environment variable. See the .Sx ENVIRONMENT section below. +.It Fl s Ar section +Another way of specifying the section, for compatibility with +.Nm +on other operating systems. .It Fl w List the pathnames of the manual pages which .Nm @@ -181,12 +187,6 @@ would display for the specified and .Ar name combination. -.It Fl f -Locate man pages matching the -.Ar command -in much the same way -.Xr whatis 1 -works. .El .Pp The optional @@ -228,7 +228,7 @@ configuration file (see specifies the possible .Ar section values, and their search order. -If only a single argument is specified or if the first argument is +If only a single argument is specified, or if the first argument is not a valid section, .Nm assumes that the argument is the name of a manual page to be displayed. @@ -260,8 +260,8 @@ variable. The format of the path is a colon .Pq Ql \&: separated list of directories. -The subdirectories to be searched as well as their search order -is specified by the +The subdirectories to be searched, as well as their search order, +are specified by the .Dq _subdir line in the .Nm diff --git a/usr.bin/man/man.c b/usr.bin/man/man.c index 9fec70f73df..cc04876b357 100644 --- a/usr.bin/man/man.c +++ b/usr.bin/man/man.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man.c,v 1.27 2003/12/16 18:58:46 millert Exp $ */ +/* $OpenBSD: man.c,v 1.28 2004/02/23 14:14:14 jmc Exp $ */ /* $NetBSD: man.c,v 1.7 1995/09/28 06:05:34 tls Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)man.c 8.17 (Berkeley) 1/31/95"; #else -static char rcsid[] = "$OpenBSD: man.c,v 1.27 2003/12/16 18:58:46 millert Exp $"; +static char rcsid[] = "$OpenBSD: man.c,v 1.28 2004/02/23 14:14:14 jmc Exp $"; #endif #endif /* not lint */ @@ -792,8 +792,9 @@ static void usage(void) { (void)fprintf(stderr, "usage: %s [-achw] [-C file] [-M path] [-m path] " - "[-s section] [-S subsection] [section] title ...\n", __progname); - (void)fprintf(stderr, "usage: %s -k keyword\n", __progname); + "[-S subsection] [-s section]\n\t [section] name [...]\n", + __progname); (void)fprintf(stderr, "usage: %s -f command\n", __progname); + (void)fprintf(stderr, "usage: %s -k keyword\n", __progname); exit(1); } diff --git a/usr.bin/man/man.conf.5 b/usr.bin/man/man.conf.5 index c2cbb2712c3..4d91f3b4c1f 100644 --- a/usr.bin/man/man.conf.5 +++ b/usr.bin/man/man.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: man.conf.5,v 1.10 2003/06/10 09:12:11 jmc Exp $ +.\" $OpenBSD: man.conf.5,v 1.11 2004/02/23 14:14:14 jmc Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -48,22 +48,28 @@ search for manual pages or their database files as specified by the file. Manual pages are normally expected to be preformatted (see .Xr nroff 1 ) -and named with a trailing ``.0''. +and named with a trailing +.Sq .0 . .Pp The .Nm man.conf file contains two types of lines. .Pp -The first type of line is a ``section'' line, which contains a -section name followed by one or more directory paths. +The first type of line is a +.Dq section +line, which contains a section name followed by one or more directory paths. The directory paths may contain the normal shell globbing characters, -including curly braces (``{}''); to escape a shell globbing character, -precede it with a backslash (``\e''). +including curly braces +.Pq Sq {} ; +to escape a shell globbing character, precede it with a backslash +.Pq Sq \e . Lines in this format specify that manual pages for the section may be found in the following directories. .Pp -Directories named with a trailing slash character (``/'') are expected -to contain subdirectories of manual pages, (see the keyword ``_subdir'' +Directories named with a trailing slash character +.Pq Sq / +are expected to contain subdirectories of manual pages, (see the keyword +.Dq _subdir below) instead of manual pages. These subdirectories are searched instead of the directory. .Pp @@ -77,30 +83,44 @@ file. .Pp Section names are unrestricted except for the reserved words specified below; in general, you should avoid anything with a leading underscore -(``_'') to avoid future incompatibilities. +.Pq Sq _ +to avoid future incompatibilities. .Pp -The section named ``_default'' is the list of directories that will +The section named +.Dq _default +is the list of directories that will be searched if no section is specified by the user. .Pp -The second type of line is preceded with a ``keyword''. +The second type of line is preceded with a +.Dq keyword . The possible keywords and their meanings are as follows: .Bl -tag -width "_version" .It _build -Man file names, regardless of their format, are expected to end in -a ``.*'' pattern, i.e., a ``.'' followed by some suffix. +Man file names, regardless of their format, are expected to end in a +.Sq .* +pattern, i.e. a +.Sq .\& +followed by some suffix. The first field of a _build line lists a suffix which indicates files which need to be reformatted or manipulated in some way before being displayed to the user. The suffix may contain the normal shell globbing characters (NOT -including curly braces (``{}'')). +including curly braces +.Pq Sq {} ) . The rest of the line must be a shell command line, the standard output of which is the manual page in a format which may be directly displayed to the user. -Any occurrences of the string ``%s'' in the shell command line will +Any occurrences of the string +.Sq %s +in the shell command line will be replaced by the name of the file which is being reformatted. .It _subdir -The list (in search order) of subdirectories which will be searched in -any directory named with a trailing slash (``/'') character. +The list +.Pq in search order +of subdirectories which will be searched in +any directory named with a trailing slash +.Pq Sq / +character. This list is also used when a path is specified to the .Xr man 1 utility by the user, using the @@ -111,18 +131,23 @@ and .Fl m options. .It _suffix -Man file names, regardless of their format, are expected to end in -a ``.*'' pattern, i.e. a ``.'' followed by some suffix. +Man file names, regardless of their format, are expected to end in a +.Sq .* +pattern, i.e. a +.Sq .\& +followed by some suffix. Each field of a _suffix line is a suffix which indicates files which do not need to be reformatted or manipulated in any way, but which may be directly displayed to the user. Each suffix may contain the normal shell globbing characters (NOT -including curly braces (``{}'')). +including curly braces +.Pq Sq {} ) . .It _version The version of the configuration file. .It _whatdb -The full pathname (not just a directory path) for a database to be used -by the +The full pathname +.Pq not just a directory path +for a database to be used by the .Xr apropos 1 and .Xr whatis 1 @@ -133,8 +158,9 @@ Multiple specifications for all types of lines are cumulative and the entries are used in the order listed in the file; multiple entries may be listed per line, as well. .Pp -Empty lines or lines whose first non-whitespace character is a hash -mark (``#'') are ignored. +Empty lines or lines whose first non-whitespace character is a hash mark +.Pq Sq # +are ignored. .Sh FILES .Bl -tag -width /etc/man.conf -compact .It Pa /etc/man.conf @@ -157,28 +183,34 @@ sect3 /usr/share/man/{old/,}cat3 By default, the command .Dq Li man mktemp will search for -``mktemp.<any_digit>'' and ``mktemp.tbl'' +.Dq mktemp.\*(Ltany_digit\*(Gt +and +.Dq mktemp.tbl in the directories -.Dq Pa /usr/share/man/cat1 , -.Dq Pa /usr/share/man/cat2 , +.Pa /usr/share/man/cat1 , +.Pa /usr/share/man/cat2 , and -.Dq Pa /usr/share/man/cat3 . -If on a machine of type ``vax'', the subdirectory ``vax'' in each -directory would be searched as well, before the directory was +.Pa /usr/share/man/cat3 . +If on a machine of type +.Dq vax , +the subdirectory +.Dq vax +in each directory would be searched as well, before the directory was searched. .Pp -If ``mktemp.tbl'' was found first, the command -.Dq Li tbl <manual page> \&| nroff -man +If +.Dq mktemp.tbl +was found first, the command +.Dq Li tbl mktemp.tbl \&| nroff -man would be run to build a man page for display to the user. .Pp The command .Dq Li man sect3 mktemp would search the directories -.Dq Pa /usr/share/man/old/cat3 +.Pa /usr/share/man/old/cat3 and -.Dq Pa /usr/share/man/cat3 , -in that order, for -the +.Pa /usr/share/man/cat3 , +in that order, for the .Xr mktemp 1 manual page. If a subdirectory with the same name as the current machine type |