diff options
author | EuAndreh <eu@euandre.org> | 2023-04-01 10:38:26 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-04-01 10:38:31 -0300 |
commit | fea2fc7600315163eb20ff39845e12b23bdadd65 (patch) | |
tree | 8f37a5fd3a91c3c6a9ff95fd255c7fc54f3c32ba /aux/lib.sh | |
parent | Update po/ with newer strings (diff) | |
download | remembering-fea2fc7600315163eb20ff39845e12b23bdadd65.tar.gz remembering-fea2fc7600315163eb20ff39845e12b23bdadd65.tar.xz |
aux/lib.sh: Add generic assert_arg()
Diffstat (limited to 'aux/lib.sh')
-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 | |