summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsa Venton <asav1410@gmail.com>2020-10-31 12:08:02 +0000
committerAsa Venton <asav1410@gmail.com>2020-10-31 12:08:02 +0000
commit12ff6305df6ac2c91fc298a6d8ab2611fc5f3011 (patch)
treec3f27ea7c0e81a800b16a45658048bd0ab845ecf
parentc8f6e435a435815bc24cd2420116e59204c272e8 (diff)
Add better handling of no definition found.
-rwxr-xr-xoedquery.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/oedquery.sh b/oedquery.sh
index d2d1082..dd2c50a 100755
--- a/oedquery.sh
+++ b/oedquery.sh
@@ -67,6 +67,11 @@ _define() {
if [[ -z $defintion ]]
then
definition=$(_jq '.entries[0].senses[0].shortDefinitions[0]')
+ if [[ $definition == "null" ]]
+ then
+ echo "No definiton found, if you're sure it's a word try the headword or use -h for help."
+ exit
+ fi
fi
output="$output $definition "
examplePhrase=$(_jq '.entries[0].senses[0].examples[0].text')