Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/wtf allow multiple '-f acronyms' arguments to be given...



details:   https://anonhg.NetBSD.org/src/rev/9dda1077c0a6
branches:  trunk
changeset: 779020:9dda1077c0a6
user:      jschauma <jschauma%NetBSD.org@localhost>
date:      Thu Apr 26 01:55:14 2012 +0000

description:
allow multiple '-f acronyms' arguments to be given, which makes this behave
more consistently with ACRONYMSDB, which may also point to multiple files

diffstat:

 games/wtf/wtf |  24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diffs (54 lines):

diff -r af009eac0a5c -r 9dda1077c0a6 games/wtf/wtf
--- a/games/wtf/wtf     Thu Apr 26 00:50:10 2012 +0000
+++ b/games/wtf/wtf     Thu Apr 26 01:55:14 2012 +0000
@@ -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 @@
        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 @@
 while [ $# -gt 0 ]; do
        case "$1" in
                -f)
-                       acronyms=$2; shift
+                       acronyms="$2 $acronyms"; shift
                        ;;
                --)
                        shift; break
@@ -44,8 +37,17 @@
        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



Home | Main Index | Thread Index | Old Index