diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2022-07-20 08:41:34 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2022-07-20 08:41:34 +0100 |
commit | 2e62dec31c3164218339c5cf72d6d3aaba69d816 (patch) | |
tree | 119ead92241c27c46ab805a98a5cfde87a6b5788 | |
parent | 3f49ac14d1ae70cdb79e956731064086d40f6ef4 (diff) |
added dict
Diffstat (limited to '')
-rwxr-xr-x | dict | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,24 @@ +#!/usr/local/bin/bash + +URL=https://en.m.wiktionary.org/wiki/ +URLT=https://www.wordnik.com/words/WORD#relate +CMD=lynx + +function usage { + echo + echo "Usage: dic [WORD] [-t (search thesaurus)] [-h (display this help)]" + echo " Searches for WORD at wiktionary. If -t is passed, then searches for word at wordnik, using their synonyms feature." +} + +if [[ $# -eq 0 ]]; then + usage + exit 1 +fi + +if [[ "$1" = "-t" ]]; then + URLTx=${URLT/WORD/$2} + $CMD "$URLTx" + shift +else + $CMD "$URL$1" +fi |