From a0bb023d782dd2d8703670d560b5ccd8d25d640e Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 4 Nov 2021 12:25:04 +0300 Subject: bins: shfmt, weasel suite, spark --- .local/bin/weasel | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 .local/bin/weasel (limited to '.local/bin/weasel') 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 @@ +#!/usr/bin/env bash + +weasels="many|various|very|fairly|several|extremely\ + |exceedingly|quite|remarkably|few|surprisingly\ + |mostly|largely|huge|tiny|((are|is) a number)\ + |excellent|interestingly|significantly\ + |substantially|clearly|vast|relatively|completely" + +wordfile="" + +# Check for an alternate weasel file +if [ -f "$HOME"/etc/words/weasels ]; then + wordfile="$HOME/etc/words/weasels" +fi + +if [ -f "$WORDSDIR"/weasels ]; then + wordfile="$WORDSDIR/weasels" +fi + +if [ -f words/weasels ]; then + wordfile="words/weasels" +fi + +if [ ! "$wordfile" = "" ]; then + weasels="xyzabc123" + for w in $(cat $wordfile); do + weasels="$weasels|$w" + done +fi + +if [ "$1" = "" ]; then + echo "usage: $(basename "$0") ..." + exit +fi + +grep -E -i -n --color "\\b($weasels)\\b" "$*" + +exit $? -- cgit v1.2.3-70-g09d2