diff options
author | EuAndreh <eu@euandre.org> | 2021-07-04 16:17:09 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-07-04 16:17:09 -0300 |
commit | 209af7d8849515fd9f8bc2873bb7e999b2d14240 (patch) | |
tree | ff2a9c5a611d47316315fbc26dc23f052c630e85 /aux/workflow/assert-readme.sh | |
parent | dependencies.dot: Add colors to all; remove makecheck dependency; tabify (diff) | |
download | packages-209af7d8849515fd9f8bc2873bb7e999b2d14240.tar.gz packages-209af7d8849515fd9f8bc2873bb7e999b2d14240.tar.xz |
aux/: Update, adjust Makefile accordingly
Diffstat (limited to 'aux/workflow/assert-readme.sh')
-rwxr-xr-x | aux/workflow/assert-readme.sh | 28 |
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" |