summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsa Venton <asav1410@gmail.com>2020-11-01 13:15:35 +0000
committerAsa Venton <asav1410@gmail.com>2020-11-01 13:15:35 +0000
commit6610c11f5f082ecadc183132bf28eb615be555ff (patch)
tree85750fcd683e9989353e24242512faa33f7a3dc0
parent12ff6305df6ac2c91fc298a6d8ab2611fc5f3011 (diff)
Add yet another fallback if no definition is found as 'defintion' or 'shortDefinition'.
-rwxr-xr-xoedquery.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/oedquery.sh b/oedquery.sh
index dd2c50a..f21faa1 100755
--- a/oedquery.sh
+++ b/oedquery.sh
@@ -69,8 +69,12 @@ _define() {
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
+ definition=$(_jq '.entries[0].senses[0].crossReferenceMarkers[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
fi
output="$output $definition "