commit 29d2fea86cbb514388128d3ce5923aad2b09fb68
parent 9f4561b4d17f4d181b34b49a29903567c31113a9
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Sat, 12 Sep 2020 13:22:31 -0700
Add usage function and flag
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/scripts/.local/bin/feed b/scripts/.local/bin/feed
@@ -3,6 +3,13 @@
set -eu
+# display usage
+# usage(void)
+usage()
+{
+ echo "usage: `basename $0` [-hln]"
+}
+
# return html or plain-text from specified files or stdin
# format([file], ...)
format()
@@ -35,6 +42,7 @@ if [ $# -gt 0 ]; then
fi
case "${cmd:=}"
in
+ -h) usage; exit 2;;
-l) show $@;;
-n) nth $@ | format;;
*) egrep -i "$cmd" $@ | format;;