Source-Changes-HG archive

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

[src/trunk]: src/games/wtf PR/47178 from Bug Hunting



details:   https://anonhg.NetBSD.org/src/rev/443b20f41a58
branches:  trunk
changeset: 782787:443b20f41a58
user:      abs <abs%NetBSD.org@localhost>
date:      Tue Nov 20 12:40:54 2012 +0000

description:
PR/47178 from Bug Hunting

src/games/wtf/wtf:
- Correct `usage' (to match new `SYNOPSIS' from man page);
- augment comment on quering pkgsrc's help facility;
- correct interpretation of pkgsrc' help facility query result.

src/games/wtf/wtf.6:
- enhance `SYNOPSIS', document description (`.Dd'), and overal
  program description;
- augment description about quering pkgsrc's help facility;
- improve wording;
- augment `HISTORY' section;
- bump date.

diffstat:

 games/wtf/wtf   |   9 +++++----
 games/wtf/wtf.6 |  35 +++++++++++++++++++++--------------
 2 files changed, 26 insertions(+), 18 deletions(-)

diffs (104 lines):

diff -r 9c3a10ea8270 -r 443b20f41a58 games/wtf/wtf
--- a/games/wtf/wtf     Tue Nov 20 12:37:29 2012 +0000
+++ b/games/wtf/wtf     Tue Nov 20 12:40:54 2012 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#      $NetBSD: wtf,v 1.18 2012/10/03 19:50:06 wiz Exp $
+#      $NetBSD: wtf,v 1.19 2012/11/20 12:40:54 abs Exp $
 #
 # Public domain
 #
@@ -8,7 +8,7 @@
 PROGNAME="$(basename "$0")"
 
 usage() {
-       echo "usage: $PROGNAME [-f dbfile] [is] <acronym> ..."
+       echo "usage: $PROGNAME [-f dbfile] [is] term ..."
        exit 1
 }
 
@@ -76,10 +76,11 @@
                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
diff -r 9c3a10ea8270 -r 443b20f41a58 games/wtf/wtf.6
--- a/games/wtf/wtf.6   Tue Nov 20 12:37:29 2012 +0000
+++ b/games/wtf/wtf.6   Tue Nov 20 12:40:54 2012 +0000
@@ -1,41 +1,46 @@
-.\"    $NetBSD: wtf.6,v 1.15 2012/10/03 19:50:43 wiz Exp $
+.\"    $NetBSD: wtf.6,v 1.16 2012/11/20 12:40:54 abs Exp $
 .\"
 .\" Public Domain
 .\"
-.Dd October 3, 2012
+.Dd November 20, 2012
 .Dt WTF 6
 .Os
 .Sh NAME
 .Nm wtf
-.Nd translate acronyms
+.Nd look up terms
 .Sh SYNOPSIS
 .Nm
 .Op Fl f Ar dbfile
 .Op Ar is
-.Ar acronym ...
+.Ar term ...
 .Sh DESCRIPTION
 The
 .Nm
-utility displays the expansion of one or more acronyms
-specified on the command line.
-If an acronym is not in any of the acronym databases,
+utility looks up the meaning of one or more
+.Ar term
+operands specified on the command line.
+.Pp
+.Ar term
+will first be searched for as an acronym in the acronym databases,
 which are expected to be in the format
-.Dq acronym[tab]meaning ,
+.Dq acronym[tab]meaning .
+If no match has been found,
 .Nm
-will check to see if it is known by
+will check to see if the term is known by
 .Xr whatis 1 ,
 .Xr pkg_info 1 ,
-or via pkgsrc's internal help mechanism,
+or, when called from within a pkgsrc package directory,
+pkgsrc's internal help facility,
 .Dq make help topic=XXX .
 .Pp
-If
-.Dq is
-is specified on the command line, it will be ignored, allowing the
+The optional
+.Ar is
+operand will be ignored, allowing the
 fairly natural
 .Dq wtf is WTF
 usage.
 .Pp
-The following options are available:
+The following option is available:
 .Bl -tag -width flag
 .It Fl f Ar dbfile
 Overrides the default list of acronym databases, bypassing the value of the
@@ -70,3 +75,5 @@
 .Nm
 first appeared in
 .Nx 1.5 .
+Initially it only translated acronyms;
+functionality to look up the meaning of terms in other sources was added later.



Home | Main Index | Thread Index | Old Index