Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/games/wtf/wtf,v rcsdiff: /ftp/cvs/cvsroot/src/games/wtf/wtf,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.17 retrieving revision 1.17.2.2 diff -u -p -r1.17 -r1.17.2.2 --- src/games/wtf/wtf 2012/04/26 03:16:13 1.17 +++ src/games/wtf/wtf 2013/02/25 00:27:45 1.17.2.2 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: wtf,v 1.17 2012/04/26 03:16:13 christos Exp $ +# $NetBSD: wtf,v 1.17.2.2 2013/02/25 00:27:45 tls Exp $ # # Public domain # @@ -8,7 +8,7 @@ PROGNAME="$(basename "$0")" usage() { - echo "Usage: $PROGNAME [-f dbfile] [is] " + echo "usage: $PROGNAME [-f dbfile] [is] term ..." exit 1 } @@ -39,21 +39,21 @@ if [ -z "$acronyms" ]; then fi if [ -z "$acronyms" ]; then - echo "$PROGNAME: acronyms database not found!" >&2 + echo "$PROGNAME: acronym 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 + echo "$PROGNAME: cannot open acronym database file \`$f'" >&2 exit 1 fi done rv=0 for i; do - # Search acronyms list first + # Search acronym list first target="$(echo "$i" | tr '[a-z]' '[A-Z]')" ans="$(fgrep -h "$target" $acronyms 2>/dev/null \ | sed -ne "\|^$target[[:space:]]|s|^$target[[:space:]]*||p")" @@ -76,10 +76,11 @@ for i; do continue fi - # Try querying pkgsrc's help facility next + # If called from pkgsrc package directory, + # try querying pkgsrc's help facility next if [ -f ../../mk/bsd.pkg.mk ]; then ans="$(make help topic="$i")" - if [ $? -eq 0 ]; then + if [ "$ans" != "No help found for $i." ]; then echo "$i: $ans" continue fi