Allen Briggs' wtf(6) to grovel the acronyms database.

This commit is contained in:
mrg 1999-07-22 01:03:20 +00:00
parent 8b10c79f68
commit 3fd868859a
3 changed files with 80 additions and 0 deletions

7
games/wtf/Makefile Normal file
View File

@ -0,0 +1,7 @@
# $NetBSD: Makefile,v 1.1 1999/07/22 01:03:20 mrg Exp $
SCRIPTS= wtf
SCRIPTSDIR= /usr/games
MAN= wtf.6
.include <bsd.prog.mk>

30
games/wtf/wtf Normal file
View File

@ -0,0 +1,30 @@
#!/bin/sh
#
# $NetBSD: wtf,v 1.1 1999/07/22 01:03:20 mrg Exp $
#
# Public domain
#
acronyms=${ACRONYMDB:-/usr/share/misc/acronyms}
if [ $1 = "is" ] ; then
shift
fi
if [ $# -lt 1 ] ; then
echo "Usage: $0 [is] <acronym>"
fi
rv=0
while [ $# -gt 0 ] ; do
target=`echo $1 | tr '[a-z]' '[A-Z]'`
ans=`sed -ne "/^$target/s/^$target[ ]*//p" < $acronyms 2>/dev/null`
if [ "$ans" != "" ] ; then
echo "$target: $ans"
else
echo "Gee... I don't know what $1 means..."
rv=1
fi
shift
done
exit $rv

43
games/wtf/wtf.6 Normal file
View File

@ -0,0 +1,43 @@
.\" $NetBSD: wtf.6,v 1.1 1999/07/22 01:03:21 mrg Exp $
.\"
.\" Public Domain
.\"
.Dd July 21, 1999
.Dt WTF 1
.Os
.Sh NAME
.Nm wtf
.Nd translates acronyms for you
.Sh SYNOPSIS
.Nm
.Op Ar is
.Ar acronym Ar ...
.Sh DESCRIPTION
The
.Nm
utility displays the expansion of the acronyms
specified on the command line.
.Pp
If
.Dq is
is specified on the command line, it will be ignored, allowing the
fairly natural
.Dq wtf is WTF
usage.
.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).
.El
.Sh FILES
.Bl -tag -width /usr/share/misc/acronyms -compact
.It Pa /usr/share/misc/acronyms
default acronym database.
.El
.Sh HISTORY
.Nm
first appeared in
.Nx 1.5 .