From 6610c11f5f082ecadc183132bf28eb615be555ff Mon Sep 17 00:00:00 2001 From: Asa Venton Date: Sun, 1 Nov 2020 13:15:35 +0000 Subject: Add yet another fallback if no definition is found as 'defintion' or 'shortDefinition'. --- oedquery.sh | 8 ++++++-- 1 file 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 " -- cgit v1.2.3