diff options
author | Asa Venton <asav1410@gmail.com> | 2020-10-19 18:20:36 +0100 |
---|---|---|
committer | Asa Venton <asav1410@gmail.com> | 2020-10-19 18:20:36 +0100 |
commit | 5921e349f42bc1cf1d2e65dbca7a6afe6f4d9263 (patch) | |
tree | bd94687a35db94b8c2c178788f505933603dc675 | |
parent | ef541f971162e798103db13059bd1e3b3898e7da (diff) |
Add commas to thesaurus output, fix word of the day flag.
-rwxr-xr-x | oedquery.sh | 6 |
1 files 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 |