From: Silvio Rhatto Date: Fri, 4 Dec 2020 21:14:35 +0000 (-0300) Subject: Feat: dict wrapper X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=81a004961db88d74b01dab2ef723b54d1c10d1e5;p=scripts.git Feat: dict wrapper --- diff --git a/dict b/dict new file mode 100755 index 0000000..6d58fe9 --- /dev/null +++ b/dict @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Dictionary wrapper. +# + +# Parameters +BASENAME="`basename $0`" +DICT="/usr/bin/dict" + +# Dispatch +if [ -x "$DICT" ]; then + $DICT "$@" +else + if which surfraw &> /dev/null; then + surfraw wiktionary "$@" + else + echo "error: no suitable dictionary found in the system" + exit 1 + fi +fi