-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwtf.1
406 lines (406 loc) · 10.4 KB
/
wtf.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
.\" $MirOS: wtf/wtf.1,v 1.43 2024/03/20 22:46:51 tg Exp $
.\" $NetBSD: wtf.6,v 1.4 2001/04/02 22:42:40 wiz Exp $
.\"-
.\" Copyright © 2002, 2003, 2006, 2010, 2011, 2012, 2014, 2015,
.\" 2016, 2017, 2019, 2020, 2022, 2024
.\" mirabilos <[email protected]>
.\"
.\" Provided that these terms and disclaimer and all copyright notices
.\" are retained or reproduced in an accompanying document, permission
.\" is granted to deal in this work without restriction, including un‐
.\" limited rights to use, publicly perform, distribute, sell, modify,
.\" merge, give away, or sublicence.
.\"
.\" This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to
.\" the utmost extent permitted by applicable law, neither express nor
.\" implied; without malicious intent or gross negligence. In no event
.\" may a licensor, author or contributor be held liable for indirect,
.\" direct, other damage, loss, or other issues arising in any way out
.\" of dealing in the work, even if advised of the possibility of such
.\" damage or existence of a defect, except proven that it results out
.\" of said person’s immediate fault when using the work as intended.
.\"-
.\" $miros: contrib/samples/portmdoc,v 1.23 2024/01/04 22:52:50 tg Exp $
.\"-
.\" Copyright © 2008, 2009, 2010, 2016, 2018, 2020, 2023
.\" mirabilos <[email protected]>
.\"
.\" Glue GNU groff (BSD and GNU mdoc both) to AT&T nroff (UCB mdoc).
.\" * ` generates ‘ in gnroff, so use \`
.\" * ' generates ’ in gnroff, \' generates ´, so use \*(aq
.\" * - generates ‐ in gnroff, \- generates −, so .tr it to -
.\" thus use - for hyphens and \- for minus signs and option dashes
.\" * ~ is size-reduced and placed atop in groff, so use \*(TI
.\" * ^ is size-reduced and placed atop in groff, so use \*(ha
.\" * \(en does not work in nroff, so use \*(en for a solo en dash
.\" * and \*(EM for a correctly spaced em dash
.\" * <>| are problematic, so redefine and use \*(Lt\*(Gt\*(Ba
.\" Also make sure to use \& *before* a punctuation char that is to not
.\" be interpreted as punctuation, and especially with two-letter words
.\" but also (after) a period that does not end a sentence (“e.g.\&”).
.\"-
.\"
.\" Implement .Dd with the Mdocdate RCS keyword
.\"
.rn Dd xD
.de Dd
.ie \\$1$Mdocdate: \{\
. xD \\$2 \\$3, \\$4
.\}
.el .xD \\$1 \\$2 \\$3
..
.\"
.\" .Dd must come before most everything, because when called
.\" with -mandoc it loads -mdoc via .so in .Dd (first macro).
.\"
.Dd $Mdocdate: March 20 2024 $
.\"
.\" Check which macro package we use, and do other -mdoc setup.
.\"
.ie \n(.g \{\
. if n .ss \n[.ss] 0
. if \*[.T]ascii .tr \-\N'45'
. if \*[.T]latin1 .tr \-\N'45'
. if \*[.T]utf8 .tr \-\N'45'
. if \*[.T]utf8 .tr \(la\*(Lt
. if \*[.T]utf8 .tr \(ra\*(Gt
. ds <= \(<=
. ds >= \(>=
. ds Rq \(rq
. ds Lq \(lq
. ds sL \(aq
. ds sR \(aq
. if \*[.T]utf8 .ds sL `
. if \*[.T]ps .ds sL `
. if \*[.T]utf8 .ds sR '
. if \*[.T]ps .ds sR '
. ds aq \(aq
. ds TI \(ti
. ds ha \(ha
. ds en \(en
. ie d volume-ds-1 .ds tT gnu
. el .ie d doc-volume-ds-1 .ds tT gnp
. el .ds tT bsd
.\}
.el \{\
. ds aq '
. ds TI ~
. ds ha ^
. ds en \(em
. ds tT ucb
.\}
.ie n \{\
. ds EM \ \(em\ \&
.\}
.el \{\
. ds EM \f(TR\|\(em\|\fP
.\}
.\"
.\" Add UCB mdoc compatibility to GNU mdoc
.\" Implement .Mx (MirBSD)
.\"
.ie "\*(tT"gnu" \{\
. ds sP \s0
. ds tN \*[Tn-font-size]
. eo
. de Mx
. nr curr-font \n[.f]
. nr curr-size \n[.ps]
. ds str-Mx \f[\n[curr-font]]\s[\n[curr-size]u]
. ds str-Mx1 \*(tN\%MirBSD\*[str-Mx]
. if !\n[arg-limit] \
. if \n[.$] \{\
. ds macro-name Mx
. parse-args \$@
. \}
. if (\n[arg-limit] > \n[arg-ptr]) \{\
. nr arg-ptr +1
. ie (\n[type\n[arg-ptr]] == 2) \
. ds str-Mx1 \*(tN\%MirBSD\~#\*[arg\n[arg-ptr]]\*[str-Mx]
. el \
. nr arg-ptr -1
. \}
. ds arg\n[arg-ptr] "\*[str-Mx1]
. nr type\n[arg-ptr] 2
. ds space\n[arg-ptr] "\*[space]
. nr num-args (\n[arg-limit] - \n[arg-ptr])
. nr arg-limit \n[arg-ptr]
. if \n[num-args] \
. parse-space-vector
. print-recursive
..
. de Aq
. if !\n[arg-limit] \
. ds macro-name Aq
. ie \n[in-authors-section] \{\
. ds quote-left \*(Lt
. ds quote-right \*(Gt
. \}
. el \{\
. ds quote-left \[la]
. ds quote-right \[ra]
. \}
. enclose-string \$@
..
. ec
.\}
.el .ie "\*(tT"gnp" \{\
. ds sP \s0
. ie t .ds tN \s[(\n[.ps]u-1z)]
. el .ds tN
. eo
. de Mx
. nr doc-curr-font \n[.f]
. nr doc-curr-size \n[.ps]
. ds doc-str-Mx \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]
. ds doc-str-Mx1 \*(tN\%MirBSD\*[doc-str-Mx]
. if !\n[doc-arg-limit] \
. if \n[.$] \{\
. ds doc-macro-name Mx
. doc-parse-args \$@
. \}
. if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
. nr doc-arg-ptr +1
. ie (\n[doc-type\n[doc-arg-ptr]] == 2) \
. ds doc-str-Mx1 \*(tN\%MirBSD\~#\*[doc-arg\n[doc-arg-ptr]]\*[doc-str-Mx]
. el \
. nr doc-arg-ptr -1
. \}
. ds doc-arg\n[doc-arg-ptr] "\*[doc-str-Mx1]
. nr doc-type\n[doc-arg-ptr] 2
. ds doc-space\n[doc-arg-ptr] "\*[doc-space]
. nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
. nr doc-arg-limit \n[doc-arg-ptr]
. if \n[doc-num-args] \
. doc-parse-space-vector
. doc-print-recursive
..
. ec
.\}
.el \{\
. de Mx
. nr cF \\n(.f
. nr cZ \\n(.s
. ds aa \&\f\\n(cF\s\\n(cZ
. if \\n(aC==0 \{\
. ie \\n(.$==0 \&\\*(tNMirBSD\\*(aa
. el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
. \}
. if \\n(aC>\\n(aP \{\
. nr aP \\n(aP+1
. ie \\n(C\\n(aP==2 \{\
. nr xX 0
. nr xX 1+\\*(A\\n(aP
. as b1 \&\\*(tNMirBSD\ \&
. if \\n(xX>0 .as b1 #\&
. as b1 \&\\*(A\\n(aP\\*(aa
. rr xX
. ie \\n(aC>\\n(aP \{\
. nr aP \\n(aP+1
. nR
. \}
. el .aZ
. \}
. el \{\
. as b1 \&\\*(tNMirBSD\\*(aa
. nR
. \}
. \}
..
.\}
.\" </MirCVS://contrib/samples/portmdoc>
.\"-
.Dt WTF 1
.Os
.Sh NAME
.Nm wtf
.Nd translates acronyms and abbreviations for you and searches further
.Sh SYNOPSIS
.Nm
.Op Fl AadKkPpwy
.Op Fl f Ar dbfile
.Op is \*(Ba ist \*(Ba Fl \-
.Ar acronym Ar ...
.Nm
.Fl V
.Sh DESCRIPTION
The
.Nm
utility displays the expansion of the acronyms
specified on the command line.
The following places are searched:
.Bl -tag -width Ds
.It Fl A
Search every supported source.
.It Fl a
Search the acronym database
.Pq default .
.It Fl d
Search the dictionary.
Needs a dict client installed.
.It Fl f Ar dbfile
Overrides the default acronym database, bypassing the value of the
.Ev ACRONYMDB
variable.
.It Fl K
Search manual pages with
.Nm man Fl k
.Pq also known as Nm apropos .
.It Fl k
Search manual pages
.Pq same as as Fl k ,
but match in page name only.
.It Fl P
Search the (apt or yum) package database or ports
.Pa INDEX .
.br
Match in package name and description.
.It Fl p
Same as
.Fl p ,
except match in package name only.
.It Fl t Ar arg
Ignored
.Pq for compatibility .
.It Fl V
Display the version of
.Nm
and the acronyms database.
.It Fl w
Show matching manual page with
.Nm man Fl f
.Pq also known as Nm whatis .
.It Fl y
Show reverse dependencies of packages
.Pq currently Nm dpkg Ns -only ;
\%every search term
.Pq Dq Ar acronym
is treated as package pattern.
\%Input order is not preserved
.Pq output is sorted by distinct package names .
Only packages known to
.Nm dpkg
are considered;
.Nm apt\-cache Ic showpkg
includes not-installed packages.
.Pp
Alternative dependencies are prefixed with a pipe sign
.Pq Sq \*(Ba\& ,
\%unconditional ones with a space.
Package relationships are de\%duplicated per (real or virtual) name
expanded from the pattern: unconditional implies alternative, (Pre-)Depends
beat Recommends quell Suggests silence Enhances;
Provides are shown in full.
.Pp
.Dq Li "[unknown version]"
shows for virtual or not installed packages.
.El
.Pp
To disable an option, prefix it with a plus sign
.Pq Sq +
instead of a dash.
.Pp
If any of the
.Fl AadKkPpwy
options are given
.Pq set or unset ,
no other or default options are enabled.
.Pp
.Dq is
.Pq and the German Dq ist
as first argument are ignored like
.Dq Fl \-
to facilitate the fairly natural
.Dq Sy wtf\ is\ WTF
.Pq or Dq Sy wtf\ ist\ n8
spelling.
.Pp
The search term is translated to upper case for lookup, but besides the
26 latin letters [a\-z], the only Unicode characters mapped are listed
in the first line of the acronyms database.
Furthermore, all dots will be stripped from the search term if it
contains, after case-folding, an ASCII letter [A\-Z] followed by a dot
.Pq Sq .\& ,
or begins with a dot and is not comprised solely of dots and dashes.
.Sh ENVIRONMENT
.Bl -tag -width ACRONYMDB
.It Ev ACRONYMDB
The default acronym database may be overridden by setting the
environment variable
.Ev ACRONYMDB
to the name of a file in the proper format (acronym[tab]meaning).
.It Ev DPKG_ROOT
If set, passed as
.Nm dpkg\-query Fl \-root= Ns Ar \&$DPKG_ROOT
on
.Nm
.Fl y .
.El
.Sh FILES
.Bl -tag -width /usr/share/misc/acronyms -compact
.It Pa /usr/share/misc/acronyms
default acronym database
.It Pa /usr/bin/dict
default search path for dictionary client
.It Pa /usr/local/bin/dict
standard search path for dictionary client
.It Pa /usr/mpkg/bin/dict
extended search path for dictionary client
.It Pa /usr/ports/INDEX
default ports index file on BSD.
.El
.Sh SEE ALSO
.Xr whatis 1
.Pp
.Pa http://www.mirbsd.org/wtf.htm
.No \*(en online acronym database query
.Pp
.Pa https://edugit.org/nik/MirWTFApp
.No \*(en Android implementation
.Pp
.Pa https://www.icloud.com/shortcuts/4c39fd731b704d81a11ce917a6a97526
.Pq online
.No \*(en for Apple iOS
.Pp
.Pa https://gitlab.com/JKorte/wtf\-dos
.No \*(en FreeDOS implementation
.Pp
.Pa http://www.mirbsd.org/acronyms.gz
.No \*(en live updated acronym database
.Pp
.Pa https://github.com/othyro/wtfubar
.No \*(en another fork of
.Nx No 's acronyms
.Sh HISTORY
.Nm
first appeared in
.Nx 1.5 .
It then was ported to
.Mx 0 ,
actually being the very reason for MirOS to exist.
Initially,
.Nm wtf
only translated acronyms;
functionality to look up the meaning of terms in other sources was added later.
Option processing was added in
.Mx 11 .
.Sh CAVEATS
The acronym database is a line-based file consisting of the case-folded
(see above) search term, an ASCII HT character, and the definition.
All lines without a HT (tab) character are considered comment lines.
The file must be sorted ASCIIbetically for the first column.
The list of additional lower/upper-case pairs (separated by spaces) must
be on the first line, with two leading spaces (so it sorts first).
.Pp
The
.Fl y
functionality currently ignores any architecture qualifiers on package
names, both in dpkg's package database and in the package relationships.
This is because it's implemented without requiring \%libdpkg\-perl and in
a portable way in shell.
It also does not yet handle Provides in the matched packages.
.Sh FEEDBACK
.An mirabilos Aq [email protected]
maintains
.Nm
and the acronym database; please send any suggestions to him.