Annotation of mandoc/apropos.1, Revision 1.8
1.8 ! kristaps 1: .\" $Id: apropos.1,v 1.7 2011/11/20 21:36:00 kristaps Exp $
1.1 kristaps 2: .\"
3: .\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
4: .\"
5: .\" Permission to use, copy, modify, and distribute this software for any
6: .\" purpose with or without fee is hereby granted, provided that the above
7: .\" copyright notice and this permission notice appear in all copies.
8: .\"
9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16: .\"
1.6 kristaps 17: .Dd $Mdocdate: November 20 2011 $
1.1 kristaps 18: .Dt APROPOS 1
19: .Os
20: .Sh NAME
21: .Nm apropos
1.5 kristaps 22: .Nd search manual page databases
1.1 kristaps 23: .Sh SYNOPSIS
24: .Nm
1.7 kristaps 25: .Op Fl M Ar manpath
1.5 kristaps 26: .Op Fl m Ar manpath
1.3 kristaps 27: .Op Fl S Ar arch
28: .Op Fl s Ar section
1.4 kristaps 29: .Ar expression...
1.1 kristaps 30: .Sh DESCRIPTION
31: The
32: .Nm
1.5 kristaps 33: utility queries manual page databases generated by
1.8 ! kristaps 34: .Xr mandocdb 8 ,
1.4 kristaps 35: evaluating on
36: .Ar expression
1.5 kristaps 37: for each file in each database.
1.1 kristaps 38: Its arguments are as follows:
39: .Bl -tag -width Ds
1.7 kristaps 40: .It Fl M Ar manpath
41: Use the colon-separated path instead of the default list of paths
42: searched for
43: .Xr mandocdb 8
44: databases.
45: Invalid paths, or paths without manual databases, are ignored.
1.5 kristaps 46: .It Fl m Ar manpath
1.7 kristaps 47: Append the colon-separated paths to the list of paths searched
1.6 kristaps 48: for
1.5 kristaps 49: .Xr mandocdb 8
50: databases.
1.6 kristaps 51: Invalid paths, or paths without manual databases, are ignored.
1.3 kristaps 52: .It Fl S Ar arch
1.1 kristaps 53: Search only for a particular architecture.
1.3 kristaps 54: .It Fl s Ar cat
55: Search only for a manual section.
1.1 kristaps 56: See
57: .Xr man 1
1.3 kristaps 58: for a listing of manual sections.
1.4 kristaps 59: .El
60: .Pp
61: An
62: .Ar expression
63: consists of search terms joined by logical operators
64: .Fl a
65: .Pq and
66: and
67: .Fl o
68: .Pq or .
69: The
70: .Fl a
71: operator has precedence over
72: .Fl o
73: and both are evaluated left-to-right.
74: .Bl -tag -width Ds
75: .It \&( Ar expr No \&)
76: True if the subexpression
77: .Ar expr
78: is true.
79: .It Ar expr1 Fl a Ar expr2
80: True if both
81: .Ar expr1
82: and
83: .Ar expr2
84: are true (logical
85: .Qq and ) .
86: .It Ar expr1 Oo Fl o Oc Ar expr2
87: True if
88: .Ar expr1
89: and/or
90: .Ar expr2
91: evaluate to true (logical
92: .Qq or ) .
93: .It Ar term
94: True if
95: .Ar term
96: is satisfied.
97: This has syntax
98: .Li [key[,key]*(=~)]?val ,
99: where operand
100: .Li key
101: is an
102: .Xr mdoc 7
103: macro to query and
104: .Li val
105: is its value.
106: Operator
107: .Li \&=
108: evaluates a substring, while
109: .Li \&~
110: evaluates a regular expression.
111: .It Fl i Ar term
112: Same as
113: .Ar term ,
114: but
115: .Ar term
116: is evaluated case-insensitively.
1.1 kristaps 117: .El
118: .Pp
119: By default,
120: .Nm
1.7 kristaps 121: searches for
1.5 kristaps 122: .Xr mandocdb 8
1.7 kristaps 123: databases in the default paths stipulated by
124: .Xr man 1 ,
1.4 kristaps 125: parses terms as case-sensitive regular expressions
126: .Pq the Li \&~ operator
127: over manual names and descriptions
128: .Pq the Li \&Nm No and Li \&Nd No macros .
129: Multiple terms imply pairwise
130: .Fl o .
131: Results are sorted by manual title, with output formatted as
1.1 kristaps 132: .Pp
1.3 kristaps 133: .D1 title(sec) \- description
1.1 kristaps 134: .Pp
135: Where
136: .Qq title
137: is the manual's title (note multiple manual names may exist for one
138: title),
1.3 kristaps 139: .Qq sec
140: is the manual section, and
1.1 kristaps 141: .Qq description
142: is the manual's short description.
143: If an architecture is specified for the manual, it is displayed as
144: .Pp
145: .D1 title(cat/arch) \- description
146: .Pp
147: Resulting manuals may be accessed as
148: .Pp
1.3 kristaps 149: .Dl $ man \-s sec title
1.1 kristaps 150: .Pp
151: If an architecture is specified in the output, use
152: .Pp
1.3 kristaps 153: .Dl $ man \-s sec \-S arch title
1.6 kristaps 154: .Sh ENVIRONMENT
155: .Bl -tag -width Ds
156: .It Ev MANPATH
157: Comma-separated paths overriding the default list of paths searched for
158: manual databases.
159: Invalid paths, or paths without manual databases, are ignored.
1.7 kristaps 160: Takes precedence over
161: .Fl M .
1.6 kristaps 162: .El
1.1 kristaps 163: .\" .Sh FILES
164: .Sh EXIT STATUS
165: .Ex -std
166: .Sh EXAMPLES
167: Search for
1.4 kristaps 168: .Qq mdoc
169: within the manual name and description:
170: .Pp
171: .Dl $ apropos mdoc
172: .Pp
173: Two variants of searching for
174: .Qq mdoc ,
175: .Qq roff ,
176: or
177: .Qq man
178: within manual names and descriptions:
179: .Pp
180: .Dl $ apropos mdoc roff man
181: .Dl $ apropos mdoc \-o roff \-o man
182: .Pp
183: Search for
1.1 kristaps 184: .Qq optind
1.4 kristaps 185: and
186: .Qq optarg
187: as variable names in the library category:
1.1 kristaps 188: .Pp
1.4 kristaps 189: .Dl $ apropos \-s 3 \(dqVa~^optind$\(dq -a \(dqVa~^optarg$\(dq
1.1 kristaps 190: .Pp
1.4 kristaps 191: Search for all manuals referencing
1.1 kristaps 192: .Qq POSIX
193: in any letter case:
194: .Pp
1.4 kristaps 195: .Dl $ apropos \-\- \-i posix
1.1 kristaps 196: .Sh SEE ALSO
197: .Xr man 1 ,
198: .Xr mandoc 1 ,
199: .Xr re_format 7
200: .Sh AUTHORS
201: The
202: .Nm
203: utility was written by
1.2 kristaps 204: .An Kristaps Dzonsons ,
205: .Mt kristaps@bsd.lv .
CVSweb