aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/assert-readme.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xaux/workflow/assert-readme.sh28
1 files changed, 24 insertions, 4 deletions
diff --git a/aux/workflow/assert-readme.sh b/aux/workflow/assert-readme.sh
index 2a6c3fd..f8a05a4 100755
--- a/aux/workflow/assert-readme.sh
+++ b/aux/workflow/assert-readme.sh
@@ -1,11 +1,31 @@
#!/bin/sh
set -eu
-PROJECT="$1"
-MAILING_LIST="$2"
-shift
-shift
TLD="$(cat aux/tld.txt)"
+while getopts 'n:m:' flag; do
+ case "$flag" in
+ n)
+ PROJECT="$OPTARG"
+ ;;
+ m)
+ MAILING_LIST="$OPTARG"
+ ;;
+ *)
+ 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="$(mktemp)"
cat <<EOF >> "$EXPECTED"