diff options
-rw-r--r-- | aux/lib.sh | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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 | |