summaryrefslogtreecommitdiffstats
path: root/.local/bin/weasel
diff options
context:
space:
mode:
authorYigit Sever2021-11-04 12:25:04 +0300
committerYigit Sever2021-11-04 12:25:04 +0300
commita0bb023d782dd2d8703670d560b5ccd8d25d640e (patch)
tree1c11a649e2201e1458c4011894086f49da5ded15 /.local/bin/weasel
parent93cdb13eada4e803fb4db71fb581d9e4a03d2119 (diff)
downloaddotfiles-a0bb023d782dd2d8703670d560b5ccd8d25d640e.tar.gz
dotfiles-a0bb023d782dd2d8703670d560b5ccd8d25d640e.tar.bz2
dotfiles-a0bb023d782dd2d8703670d560b5ccd8d25d640e.zip
bins: shfmt, weasel suite, spark
Diffstat (limited to '.local/bin/weasel')
-rwxr-xr-x.local/bin/weasel38
1 files changed, 38 insertions, 0 deletions
diff --git a/.local/bin/weasel b/.local/bin/weasel
new file mode 100755
index 0000000..ce82ce3
--- /dev/null
+++ b/.local/bin/weasel
@@ -0,0 +1,38 @@
1#!/usr/bin/env bash
2
3weasels="many|various|very|fairly|several|extremely\
4 |exceedingly|quite|remarkably|few|surprisingly\
5 |mostly|largely|huge|tiny|((are|is) a number)\
6 |excellent|interestingly|significantly\
7 |substantially|clearly|vast|relatively|completely"
8
9wordfile=""
10
11# Check for an alternate weasel file
12if [ -f "$HOME"/etc/words/weasels ]; then
13 wordfile="$HOME/etc/words/weasels"
14fi
15
16if [ -f "$WORDSDIR"/weasels ]; then
17 wordfile="$WORDSDIR/weasels"
18fi
19
20if [ -f words/weasels ]; then
21 wordfile="words/weasels"
22fi
23
24if [ ! "$wordfile" = "" ]; then
25 weasels="xyzabc123"
26 for w in $(cat $wordfile); do
27 weasels="$weasels|$w"
28 done
29fi
30
31if [ "$1" = "" ]; then
32 echo "usage: $(basename "$0") <file> ..."
33 exit
34fi
35
36grep -E -i -n --color "\\b($weasels)\\b" "$*"
37
38exit $?