Subject: Re: technical acronyms (misc/17559)
To: Jan Schaumann <jschauma@netmeister.org>
From: Julio Merino <jmmv@menta.net>
List: tech-userlevel
Date: 04/09/2003 20:50:24
On Wed, 9 Apr 2003 14:47:16 -0400
Jan Schaumann <jschauma@netmeister.org> wrote:

> Julio Merino <jmmv@menta.net> wrote:
> > Ok... so I'll close the PR.
> 
> Hey, why not wait a bit and see if other people have opinions.  Things
> don't always have to be decided within 5 or 6 hours...
> 
> cgd just made a good point "in your favor". :-)

Ok ;)  About the -f option, which I think is a good idea, what about this
patch?

Index: wtf
===================================================================
RCS file: /cvsroot/src/games/wtf/wtf,v
retrieving revision 1.8
diff -u -r1.8 wtf
--- wtf	2003/02/06 15:17:01	1.8
+++ wtf	2003/04/09 18:43:56
@@ -5,14 +5,36 @@
 # Public domain
 #
 
+usage() {
+	echo "Usage: `basename $0` [-f dbfile] [is] <acronym>"
+	exit 1
+}
+
 acronyms=${ACRONYMDB:-/usr/share/misc/acronyms}
 
+args=`getopt f: $*`
+if [ $? -ne 0 ]; then
+	usage
+fi
+set -- $args
+while [ $# -gt 0 ]; do
+	case "$1" in
+		-f)
+			acronyms=$2; shift
+			;;
+		--)
+			shift; break
+			;;
+	esac
+	shift
+done
+
 if [ X"$1" = X"is" ] ; then
 	shift
 fi
 
 if [ $# -lt 1 ] ; then
-	echo "Usage: `basename $0` [is] <acronym>"
+	usage
 fi
 
 rv=0
Index: wtf.6
===================================================================
RCS file: /cvsroot/src/games/wtf/wtf.6,v
retrieving revision 1.5
diff -u -r1.5 wtf.6
--- wtf.6	2002/09/26 16:12:44	1.5
+++ wtf.6	2003/04/09 18:43:56
@@ -2,7 +2,7 @@
 .\"
 .\" Public Domain
 .\"
-.Dd July 21, 1999
+.Dd April 9, 2003
 .Dt WTF 6
 .Os
 .Sh NAME
@@ -10,6 +10,7 @@
 .Nd translates acronyms for you
 .Sh SYNOPSIS
 .Nm
+.Op Fl f Ar dbfile
 .Op Ar is
 .Ar acronym Ar ...
 .Sh DESCRIPTION
@@ -29,6 +30,14 @@
 fairly natural
 .Dq wtf is WTF
 usage.
+.Pp
+The following options are available:
+.Bl -tag -width flag
+.It Fl f Ar dbfile
+Overrides the default acronym database, bypassing the value of the
+.Ev ACRONYMDB
+variable.
+.El
 .Sh ENVIRONMENT
 .Bl -tag -width ACRONYMDB
 .It Ev ACRONYMDB

Thanks

-- 
Julio M. Merino Vidal <jmmv@menta.net>
The NetBSD Project - http://www.NetBSD.org/