commit c6b418d3b3377bc987e8e36de99f66a15c44451a
parent ed382b41f158df428208aaf28c4e53e7ae620f1e
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Thu, 18 Feb 2021 15:09:21 -0800
Remove the walt, wdef, and wex scripts
I'm going to make a separate project to replace them.
Diffstat:
3 files changed, 0 insertions(+), 64 deletions(-)
diff --git a/local/scripts/.local/bin/walt b/local/scripts/.local/bin/walt
@@ -1,17 +0,0 @@
-#!/usr/local/bin/rc -e
-#! walt -- moby thesaurus search utility
-
-# For an alphabetically split Moby Thesaurus csv file see my
-# ``cvsmoby'' repository.
-
-fn match { grep -m1 '^'^$word^',' $* }
-
-for (word in $*) {
- l = `{ dd 'bs=1' 'count=1' >[2] /dev/null <<< $word }
- match $THESAURUS_DIR/$l.csv | cut -d, -f2- | tr ',' '\n' || {
- # assumes grep error.
- if (test $status(1) -ne 1)
- exit
- printf '%s: ''%s'': Word not found.\n' `{ basename $0 } $word >[1=2]
- }
-}
diff --git a/local/scripts/.local/bin/wdef b/local/scripts/.local/bin/wdef
@@ -1,23 +0,0 @@
-#!/usr/local/bin/rc -e
-#! wdef -- dictionary search tool
-
-fn qdd { dd $* >[2] /dev/null }
-fn err { printf $* >[1=2]; exit 1 }
-
-if (test -z $DICT_DIR)
- err 'wdef: DICT_DIR: Undefined\n';
-if (test ! -d $DICT_DIR)
- err 'wdef: ''%s'': Directory nonexistent.\n' $DICT_DIR
-
-word = $1
-file = $DICT_DIR/^`{ qdd 'bs=1' 'count=1' <<< $word | tr '[:upper:]' '[:lower:]' }^'.csv'
-if (test ! -e $file)
- err 'wdef: ''%s'': File nonexistent.\n' $file;
-
-{
- ifs = '
- '
- defs = `{ grep -i '^'$word^',' $file || err 'wdef: ''%s'': No match.' $word }
- for (def in $defs)
- printf '%s\n\n' `{ cut -d, -f2- <<< $def };
-} | fmt | $PAGER
diff --git a/local/scripts/.local/bin/wex b/local/scripts/.local/bin/wex
@@ -1,24 +0,0 @@
-#!/usr/local/bin/rc -e
-#! wex -- word existence check
-
-fn qdd { dd $* >[2] /dev/null }
-fn err { printf $* >[1=2]; exit 1 }
-
-name = `{ basename $0 }
-
-if (test -z $DICT_DIR)
- err '%s: ''DICT_DIR'': Unset' $name;
-if (test ! -d $DICT_DIR)
- err '%s: ''%s'': Directory nonexistent.\n' $DICT_DIR $name;
-
-for (word in $*) {
- # could run in parellel.
- file = $DICT_DIR/^`{ qdd 'bs=1' 'count=1' <<< $word | tr '[:upper:]' '[:lower:]' }^'.csv'
- grep -iqm1 '^'$word^',' $file && {
- printf '%s: `%s` Exists.\n' $name $word;
- } || {
- if (test $status(1) '!=' 1)
- exit
- printf '%s: `%s` Nonexistent.\n' $name $word
- }
-}