diff options
author | Colin Okay <colin@cicadas.surf> | 2022-08-15 07:28:58 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-08-15 07:28:58 -0500 |
commit | b5a258652de9bf6b8f0c56e13720240e444bd93b (patch) | |
tree | 048b71666f51b7638a07a891d8f1edaa4d4f14da /threadcat | |
parent | d6f05e96cb5b139b1ea0ad7a166205d9e31c2440 (diff) |
[add] toplevel threadcat script; [altered] command scripts to fit
Diffstat (limited to 'threadcat')
-rwxr-xr-x | threadcat | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/threadcat b/threadcat new file mode 100755 index 0000000..0a5b7ad --- /dev/null +++ b/threadcat @@ -0,0 +1,24 @@ +#!/bin/bash + +THREADCAT_SUBCOMMAND=$1 + +if [ -z "${THREADCAT_USER}" ]; then + echo The THREADCAT_USER environment variable is not set. +fi + +if [ -z "${THREADCAT_SUBCOMMAND}" ]; then + echo USAGE: threadcat <COMMAND> [THREAD] + echo commands are: + echo " list lists threads, most recent first" + echo " read [THREAD] reads a thread, catting it to stdout" + echo " write [THREAD] posts to THREAD from stdin" + exit 0 +fi + +case "$THREADCAT_SUBCOMMAND" in + "list" ) threadcat-list.sh ;; + "read" ) threadcat-read.sh $2 ;; + "write" ) threadcat-write.sh $2 ;; + * ) echo Unknown subcommand $THREADCAT_SUBCOMMAND + echo commands are list, read, write;; +esac |