From 5921e349f42bc1cf1d2e65dbca7a6afe6f4d9263 Mon Sep 17 00:00:00 2001 From: Asa Venton Date: Mon, 19 Oct 2020 18:20:36 +0100 Subject: Add commas to thesaurus output, fix word of the day flag. --- oedquery.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/oedquery.sh b/oedquery.sh index 50e9fd2..e21c6f0 100755 --- a/oedquery.sh +++ b/oedquery.sh @@ -82,7 +82,7 @@ _thes() { _getdata count=0 for json in $(echo "${result}" | jq -r '.results[].lexicalEntries[0].entries[0].senses[0].synonyms[] | @base64'); do - output="$output $(_jq '.text') " + output="$output $(_jq '.text'), " ((count=count+1)) # Limit output to a resonable number of synonyms if [[ $count -ge $maxSynonyms ]] @@ -90,6 +90,8 @@ _thes() { break fi done + # remove trailing comma and space + output=$(echo $output | sed '$s/,$//') echo $output exit 0 } @@ -150,7 +152,7 @@ then elif [[ ${word} =~ "-a" ]] then _audio -elif [[ ${word} =~ "-d" ]] +elif [[ ${word} =~ "-wod" ]] then _wod else -- cgit v1.2.3