summaryrefslogtreecommitdiff
path: root/oeddefine.sh
diff options
context:
space:
mode:
Diffstat (limited to 'oeddefine.sh')
-rwxr-xr-xoeddefine.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/oeddefine.sh b/oeddefine.sh
index aa76bde..1c3ae8a 100755
--- a/oeddefine.sh
+++ b/oeddefine.sh
@@ -3,9 +3,9 @@
read word
word=$(echo $word | tr '[:upper:]' '[:lower:]')
appId=
-key=
+appKey=
language=en-gb
-OPTS='--silent -L -H "app_id: $appId" -H "app_key: $key"'
+OPTS='--silent -L -H "app_id: $appId" -H "app_key: $appKey"'
maxSynonyms=10
_getdata() {
@@ -58,8 +58,8 @@ _define() {
# Return etymology if available
_etym() {
_getdata
- output=$(echo "${result}" | jq '.results[].lexicalEntries[0].Entries[0].etymologies[0]')
- if [ -z "$output"]; then
+ output=$(echo "${result}" | jq '.results[].lexicalEntries[0].entries[0].etymologies[0]')
+ if [ -z "$output" ]; then
echo "No etymology found."
else
echo $output
@@ -88,14 +88,14 @@ _help() {
exit 0
}
-if [[ ${word} == "-h" ]] || [[ ${word} == "--help" ]] || [ -z $word ]; then
+if [[ ${word} == "-h" ]] || [[ ${word} == "--help" ]] || [[ -z $word ]]; then
_help
elif [[ ${word} == "--source" ]] || [[ ${word} == "-s" ]]; then
echo "https://www.blatech.co.uk/ars/oeddefine"
exit 0
-elif [[ ${word} == *"-t"* ]]; then
+elif [[ ${word} =~ "-t" ]]; then
_thes
-elif [[ ${word} == *"-e"* ]]; then
+elif [[ ${word} =~ "-et" ]]; then
_etym
else
_define