From 81a004961db88d74b01dab2ef723b54d1c10d1e5 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 4 Dec 2020 18:14:35 -0300 Subject: Feat: dict wrapper --- dict | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 dict 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 -- cgit v1.2.3