File xyaku-1.3.0-dict.patch of Package xyaku

--- xyaku-1.3.0.orig/addin/dict.sh.in	Sat Sep  2 16:04:19 2000
+++ xyaku-1.3.0/addin/dict.sh.in	Fri Jan 12 12:52:33 2001
@@ -11,6 +11,7 @@
 Internally, call dict, dict.pl or def, which are DICT clients.
   -s, --server       {dict.org:2628}
                      specify a DICT server and port
+  -d  --database <dbname>  select a database to search
   -h, --help         print this help and exit
   -v, --version      print version information and exit"
 
@@ -37,6 +38,10 @@
 		DICT_SERVER=`expr "$1" : '\([^:*]\)'`
 		DICT_PORT=`expr "$1" : '[^:]*:\([0-9]*\)'`
 		;;
+	-d | --database)
+	        shift
+		DICT_DATABASE=$1
+		;;
 	-h | --help) 
 		echo "$usage"; exit 0;;
 	-v | --version | --v*)
@@ -51,13 +56,16 @@
 
 
 # Determine what DICT clients to use
-if [ -x $DICT ]; then
+if type -p $DICT > /dev/null 2>&1 ; then
 	X_DICT=$DICT
 	X_ARG="-h $DICT_SERVER -p $DICT_PORT"
-elif [ -x $DICT_PL ]; then
+	if [ -n $DICT_DATABASE ]; then
+	   X_ARG="$X_ARG -d $DICT_DATABASE"
+	fi
+elif type -p $DICT_PL > /dev/null 2>&1 ; then
 	X_DICT=$DICT_PL
 	X_ARG="-s $DICT_SERVER:$DICT_PORT"
-elif [ -x $DEF ]; then
+elif type -p $DEF > /dev/null 2>&1 ; then 
 	X_DICT=$DEF
 	X_ARG="-H $DICT_SERVER -p $DICT_PORT"
 else
openSUSE Build Service is sponsored by