#!/bin/sh
# $Id: leodict,v 1.2 2005/02/16 15:15:43 wiz Exp $
# elvis: leodict 	-- Search english/german translations (dict.leo.org)
. surfraw || exit 1

w3_config_hook () {
}

w3_usage_hook () {
    cat <<EOF
Usage: $w3_argv0 [options] [search-string]
Description:
  Search German/English translation
Local options:
Examples:
  $w3_argv0 			Teleport to the dict.leo.org website
  $w3_argv0 translation		Search for the translation of translation
EOF
    w3_global_usage
}

w3_parse_option_hook () {
    opt="$1"
    optarg="$2"
    case "$opt" in
	*) return 1 ;;
    esac
    return 0
}

w3_config
w3_parse_args "$@"
# w3_args now contains a list of arguments
test -z "$w3_args" || escaped_args=`w3_url_of_arg $w3_args`

if test -z "$escaped_args"; then
    w3_browse_url "http://dict.leo.org/"
else
    w3_browse_url "http://dict.leo.org/?search=${escaped_args}"
fi
exit $?
