1.\" $MirOS: src/usr.bin/wtf/wtf.1,v 1.10 2012/08/03 18:48:07 tg Exp $
2.\" $NetBSD: wtf.6,v 1.4 2001/04/02 22:42:40 wiz Exp $
3.\"-
4.\" Copyright © 2002, 2003, 2006, 2010, 2011, 2012
5.\"	Thorsten Glaser <tg@mirbsd.org>
6.\"
7.\" Provided that these terms and disclaimer and all copyright notices
8.\" are retained or reproduced in an accompanying document, permission
9.\" is granted to deal in this work without restriction, including un‐
10.\" limited rights to use, publicly perform, distribute, sell, modify,
11.\" merge, give away, or sublicence.
12.\"
13.\" This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to
14.\" the utmost extent permitted by applicable law, neither express nor
15.\" implied; without malicious intent or gross negligence. In no event
16.\" may a licensor, author or contributor be held liable for indirect,
17.\" direct, other damage, loss, or other issues arising in any way out
18.\" of dealing in the work, even if advised of the possibility of such
19.\" damage or existence of a defect, except proven that it results out
20.\" of said person’s immediate fault when using the work as intended.
21.\"-
22.\" Try to make GNU groff and AT&T nroff more compatible
23.\" * ` generates ‘ in gnroff, so use \`
24.\" * ' generates ’ in gnroff, \' generates ´, so use \*(aq
25.\" * - generates ‐ in gnroff, \- generates −, so .tr it to -
26.\"   thus use - for hyphens and \- for minus signs and option dashes
27.\" * ~ is size-reduced and placed atop in groff, so use \*(TI
28.\" * ^ is size-reduced and placed atop in groff, so use \*(ha
29.\" * \(en does not work in nroff, so use \*(en
30.\" * <>| are problematic, so redefine and use \*(Lt\*(Gt\*(Ba
31.\" Also make sure to use \& especially with two-letter words.
32.\" The section after the "doc" macropackage has been loaded contains
33.\" additional code to convene between the UCB mdoc macropackage (and
34.\" its variant as BSD mdoc in groff) and the GNU mdoc macropackage.
35.\"
36.ie \n(.g \{\
37.	if \*[.T]ascii .tr \-\N'45'
38.	if \*[.T]latin1 .tr \-\N'45'
39.	if \*[.T]utf8 .tr \-\N'45'
40.	ds <= \[<=]
41.	ds >= \[>=]
42.	ds Rq \[rq]
43.	ds Lq \[lq]
44.	ds sL \(aq
45.	ds sR \(aq
46.	if \*[.T]utf8 .ds sL `
47.	if \*[.T]ps .ds sL `
48.	if \*[.T]utf8 .ds sR '
49.	if \*[.T]ps .ds sR '
50.	ds aq \(aq
51.	ds TI \(ti
52.	ds ha \(ha
53.	ds en \(en
54.\}
55.el \{\
56.	ds aq '
57.	ds TI ~
58.	ds ha ^
59.	ds en \(em
60.\}
61.\"
62.\" Implement .Dd with the Mdocdate RCS keyword
63.\"
64.rn Dd xD
65.de Dd
66.ie \\$1$Mdocdate: \{\
67.	xD \\$2 \\$3, \\$4
68.\}
69.el .xD \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
70..
71.\"
72.\" .Dd must come before definition of .Mx, because when called
73.\" with -mandoc, it might implement .Mx itself, but we want to
74.\" use our own definition. And .Dd must come *first*, always.
75.\"
76.Dd $Mdocdate: August 3 2012 $
77.\"
78.\" Check which macro package we use, and do other -mdoc setup.
79.\"
80.ie \n(.g \{\
81.	if \*[.T]utf8 .tr \[la]\*(Lt
82.	if \*[.T]utf8 .tr \[ra]\*(Gt
83.	ie d volume-ds-1 .ds tT gnu
84.	el .ds tT bsd
85.\}
86.el .ds tT ucb
87.\"
88.\" Implement .Mx (MirBSD)
89.\"
90.ie "\*(tT"gnu" \{\
91.	eo
92.	de Mx
93.	nr curr-font \n[.f]
94.	nr curr-size \n[.ps]
95.	ds str-Mx \f[\n[curr-font]]\s[\n[curr-size]u]
96.	ds str-Mx1 \*[Tn-font-size]\%MirOS\*[str-Mx]
97.	if !\n[arg-limit] \
98.	if \n[.$] \{\
99.	ds macro-name Mx
100.	parse-args \$@
101.	\}
102.	if (\n[arg-limit] > \n[arg-ptr]) \{\
103.	nr arg-ptr +1
104.	ie (\n[type\n[arg-ptr]] == 2) \
105.	as str-Mx1 \~\*[arg\n[arg-ptr]]
106.	el \
107.	nr arg-ptr -1
108.	\}
109.	ds arg\n[arg-ptr] "\*[str-Mx1]
110.	nr type\n[arg-ptr] 2
111.	ds space\n[arg-ptr] "\*[space]
112.	nr num-args (\n[arg-limit] - \n[arg-ptr])
113.	nr arg-limit \n[arg-ptr]
114.	if \n[num-args] \
115.	parse-space-vector
116.	print-recursive
117..
118.	ec
119.	ds sP \s0
120.	ds tN \*[Tn-font-size]
121.\}
122.el \{\
123.	de Mx
124.	nr cF \\n(.f
125.	nr cZ \\n(.s
126.	ds aa \&\f\\n(cF\s\\n(cZ
127.	if \\n(aC==0 \{\
128.		ie \\n(.$==0 \&MirOS\\*(aa
129.		el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
130.	\}
131.	if \\n(aC>\\n(aP \{\
132.		nr aP \\n(aP+1
133.		ie \\n(C\\n(aP==2 \{\
134.			as b1 \&MirOS\ #\&\\*(A\\n(aP\\*(aa
135.			ie \\n(aC>\\n(aP \{\
136.				nr aP \\n(aP+1
137.				nR
138.			\}
139.			el .aZ
140.		\}
141.		el \{\
142.			as b1 \&MirOS\\*(aa
143.			nR
144.		\}
145.	\}
146..
147.\}
148.\"-
149.Dt WTF 1
150.Os
151.Sh NAME
152.Nm wtf
153.Nd translates acronyms for you
154.Sh SYNOPSIS
155.Nm
156.Op Fl adPpw
157.Op Fl f Ar dbfile
158.Op is \*(Ba ist
159.Ar acronym Ar ...
160.Sh DESCRIPTION
161The
162.Nm
163utility displays the expansion of the acronyms
164specified on the command line.
165The following places are searched:
166.Bl -tag -width Ds
167.It Fl a
168Search the acronym database
169.Pq default .
170.It Fl d
171Search the dictionary.
172Needs a dict client installed.
173.It Fl f Ar dbfile
174Overrides the default acronym database, bypassing the value of the
175.Ev ACRONYMDB
176variable.
177.It Fl P
178Search the package database or ports
179.Pa INDEX .
180Match in package name and description.
181.It Fl p
182Search the package database or ports
183.Pa INDEX .
184Match in package name only.
185.It Fl t Ar arg
186Ignored
187.Pq for compatibility .
188.It Fl w
189Search with
190.Nm whatis
191.Pq default .
192.El
193.Pp
194To disable an option, prefix it with a plus sign
195.Pq Sq +
196instead of a dash.
197.Pp
198If
199.Dq is
200is specified on the command line, it will be ignored,
201allowing the fairly natural
202.Sy wtf\ is\ WTF
203and, for German users,
204.Sy wtf\ ist\ n8
205usage.
206.Sh ENVIRONMENT
207.Bl -tag -width ACRONYMDB
208.It Ev ACRONYMDB
209The default acronym database may be overridden by setting the
210environment variable
211.Ev ACRONYMDB
212to the name of a file in the proper format (acronym[tab]meaning).
213.El
214.Sh FILES
215.Bl -tag -width /usr/share/misc/acronyms -compact
216.It Pa /usr/share/misc/acronyms
217default acronym database
218.It Pa /usr/bin/dict
219default search path for dictionary client
220.It Pa /usr/local/bin/dict
221standard search path for dictionary client
222.It Pa /usr/mpkg/bin/dict
223extended search path for dictionary client
224.It Pa /usr/ports/INDEX
225default ports index file on BSD.
226.El
227.Sh SEE ALSO
228.Xr whatis 1
229.Pp
230.Pa https://www.mirbsd.org/wtf.htm
231.No \*(en online acronym database query
232.Pp
233.Pa https://www.mirbsd.org/acronyms
234.No \*(en live updated acronym database
235.Sh HISTORY
236.Nm
237first appeared in
238.Nx 1.5 .
239It then was ported to
240.Mx 0 ,
241actually being the very reason for MirOS to exist.
242Option processing was added in
243.Mx 11 .
244.Sh FEEDBACK
245.An Thorsten Glaser Aq tg@mirbsd.org
246maintains
247.Nm
248and the acronym database; please send any suggestions to him.
249