summaryrefslogtreecommitdiffstats
path: root/wtf
diff options
context:
space:
mode:
authorjschauma <jschauma@NetBSD.org>2012-04-26 01:55:14 +0000
committerjschauma <jschauma@NetBSD.org>2012-04-26 01:55:14 +0000
commite923f7ffbb641291154ab66e1aa4b45e2bf300c8 (patch)
tree033921439aafd41c88dad22866cc231c9be83252 /wtf
parent9762fb8e3532bd20464196142561b54fd3c658f6 (diff)
downloadbsdgames-darwin-e923f7ffbb641291154ab66e1aa4b45e2bf300c8.tar.gz
bsdgames-darwin-e923f7ffbb641291154ab66e1aa4b45e2bf300c8.tar.zst
bsdgames-darwin-e923f7ffbb641291154ab66e1aa4b45e2bf300c8.zip
allow multiple '-f acronyms' arguments to be given, which makes this behave
more consistently with ACRONYMSDB, which may also point to multiple files
Diffstat (limited to 'wtf')
-rw-r--r--wtf/wtf24
1 files changed, 13 insertions, 11 deletions
diff --git a/wtf/wtf b/wtf/wtf
index 273d482b..22bb0325 100644
--- a/wtf/wtf
+++ b/wtf/wtf
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: wtf,v 1.15 2007/08/06 21:14:36 hubertf Exp $
+# $NetBSD: wtf,v 1.16 2012/04/26 01:55:14 jschauma Exp $
#
# Public domain
#
@@ -12,13 +12,6 @@ usage() {
exit 1
}
-acronyms=${ACRONYMDB:-`ls /usr/share/misc/acronyms* 2>/dev/null`}
-
-if [ "$acronyms" = "" ]; then
- echo "$PROGNAME: acronyms database not found!" >&2
- exit 1
-fi
-
args=`getopt f: $*`
if [ $? -ne 0 ]; then
usage
@@ -27,7 +20,7 @@ set -- $args
while [ $# -gt 0 ]; do
case "$1" in
-f)
- acronyms=$2; shift
+ acronyms="$2 $acronyms"; shift
;;
--)
shift; break
@@ -44,8 +37,17 @@ if [ $# -lt 1 ] ; then
usage
fi
-for f in $acronyms
-do
+if [ "$acronyms" = "" ]; then
+ acronyms=${ACRONYMDB:-`ls /usr/share/misc/acronyms* 2>/dev/null`}
+fi
+
+if [ "$acronyms" = "" ]; then
+ echo "$PROGNAME: acronyms database not found!" >&2
+ exit 1
+fi
+
+
+for f in $acronyms ; do
if [ ! -f $f ]; then
echo "$PROGNAME: cannot open acronyms database file \`$f'" >&2
exit 1