aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aux/lib.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/aux/lib.sh b/aux/lib.sh
index 52f1315..e345bd6 100644
--- a/aux/lib.sh
+++ b/aux/lib.sh
@@ -1,8 +1,14 @@
#!/bin/sh
-#
-# Generally, utilities that I expected to exist in POSIX, but don't.
-#
+assert_arg() {
+ if [ -z "$1" ]; then
+ printf 'Missing %s.\n\n' "$2" >&2
+ cat <<-'EOF'
+ usage >&2
+ exit 2
+ EOF
+ fi
+}
uuid() {
od -xN20 /dev/urandom |