summaryrefslogtreecommitdiff
path: root/bin/extra/wd
blob: 1b56aa67959af4a66cf1f9ed1676a77282a3ce84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
[ "$1" ] || exit 1
dict "$1" |
	sed -e '/^  /!d;s/^  //' |
	sed -e '/^$/d;s/^[^ ].*$/\o033[1;4;34m&\o033[0m/' |

	# foldoc
	sed -e '/^ /s/</\o033[2m/g' -e '/^ /s/>/\o033[0m/g' | 

	# webster
	sed -r -e 's/ \\\<\w+\>\\//g' -e '/^ *\[[^]]*Webster[^]]*\]/d' |
	# replace {} by blue underline
	sed -e '/^ /s/{/\o033[4m/g' -e '/^ /s/}/\o033[0m/g' | 
	tr -d '{}' # remove {} in word definition