aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/assert-manpages.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-06-26 21:48:18 -0300
committerEuAndreh <eu@euandre.org>2021-06-26 21:49:20 -0300
commit59f34fe49527fc697bd86145aa974076c83eb404 (patch)
treeee4748e63d034b86e50b78724d5812cd7e001681 /aux/workflow/assert-manpages.sh
parentaux/utils.sh: Remove unused file (diff)
downloadremembering-59f34fe49527fc697bd86145aa974076c83eb404.tar.gz
remembering-59f34fe49527fc697bd86145aa974076c83eb404.tar.xz
aux/: Update, adapt Makefile accordingly
Diffstat (limited to 'aux/workflow/assert-manpages.sh')
-rwxr-xr-xaux/workflow/assert-manpages.sh25
1 files changed, 19 insertions, 6 deletions
diff --git a/aux/workflow/assert-manpages.sh b/aux/workflow/assert-manpages.sh
index a2bd3f9..d609685 100755
--- a/aux/workflow/assert-manpages.sh
+++ b/aux/workflow/assert-manpages.sh
@@ -1,22 +1,35 @@
#!/bin/sh
set -eu
-PROJECT="$1"
-MAILING_LIST="$2"
-shift
-shift
TLD="$(cat aux/tld.txt)"
-
IN_PLACE=false
-while getopts 'i' flag; do
+while getopts 'n:m:i' flag; do
case "$flag" in
+ n)
+ PROJECT="$OPTARG"
+ ;;
+ m)
+ MAILING_LIST="$OPTARG"
+ ;;
i)
IN_PLACE=true
;;
*)
+ exit 2
;;
esac
done
+shift $((OPTIND - 1))
+
+assert_arg() {
+ if [ -z "$1" ]; then
+ echo "Missing $2" >&2
+ exit 2
+ fi
+}
+
+assert_arg "${PROJECT:-}" '-n PROJECT'
+assert_arg "${MAILING_LIST:-}" '-m MAILING_LIST'
EXPECTED_EN="$(mktemp)"