Subject: bin/8201: wtf errors are faulty
To: None <gnats-bugs@gnats.netbsd.org>
From: Sean Doran <smd@sean.ebone.net>
List: netbsd-bugs
Date: 08/12/1999 17:05:45
>Number:         8201
>Category:       bin
>Synopsis:       wtf errors are faulty
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 12 17:05:00 1999
>Last-Modified:
>Originator:     Sean Doran
>Organization:
>Release:        Fri Aug 13 01:43:51 CEST 1999
>Environment:
	
System: NetBSD crasse.smd.ebone.net 1.4J NetBSD 1.4J (SMDHOME) #1: Fri Aug 13 00:17:56 CEST 1999 smd@crasse.smd.ebone.net:/usr/src/sys/arch/i386/compile/SMDHOME i386


>Description:

The error message for acronyms that aren't in the database should be tweaked.
Also, the error message should be emitted to stderr not stdout.

	% /usr/games/wtf NSA
	Gee...  I don't know what NSA means...

(this is echoed on stdout)

should be

	% /usr/games/wtf NSA
	NSA: No such acronym.

instead of the current error report.

Also compare:

: sean.ebone.net ; wtf NSA > /dev/null
: sean.ebone.net ;

versus

: sean.ebone.net ; ./wtf NSA > /dev/null
NSA: No such acronym.
: sean.ebone.net ;

>How-To-Repeat:

	% /usr/games/wtf <some nonexistent acronym>

>Fix:

in directory /usr/src/games/wtf: 

*** wtf.orig    Fri Aug 13 01:46:27 1999
--- wtf Fri Aug 13 01:51:53 1999
***************
*** 27,33 ****
                if [ $? -eq 0 ] ; then
                        echo "$1: $ans"
                else
!                       echo "Gee...  I don't know what $1 means..."
                        rv=1
                fi
        fi
--- 27,33 ----
                if [ $? -eq 0 ] ; then
                        echo "$1: $ans"
                else
!                       echo "$1: No such acronym." >&2
                        rv=1
                fi
        fi
>Audit-Trail:
>Unformatted: