aboutsummaryrefslogtreecommitdiff
path: root/bin/email
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-08-13 10:58:10 -0300
committerEuAndreh <eu@euandre.org>2022-08-13 10:58:10 -0300
commita0188f38d8a9702dd3d7119375173d063a5f28bc (patch)
tree3ff6e25d0125cef5d7d7db0a7ace05a71d586166 /bin/email
parentbin/httpno: Add working utility (diff)
downloaddotfiles-a0188f38d8a9702dd3d7119375173d063a5f28bc.tar.gz
dotfiles-a0188f38d8a9702dd3d7119375173d063a5f28bc.tar.xz
bin/: Replace usage of assert_arg with assert-arg
Diffstat (limited to 'bin/email')
-rwxr-xr-xbin/email15
1 files changed, 2 insertions, 13 deletions
diff --git a/bin/email b/bin/email
index 3c72086..c16ed62 100755
--- a/bin/email
+++ b/bin/email
@@ -64,19 +64,8 @@ while getopts 's:h' flag; do
done
shift $((OPTIND - 1))
-assert_arg() {
- if [ -z "$1" ]; then
- {
- printf 'Missing %s.\n' "$2"
- printf '\n'
- usage
- } >&2
- exit 2
- fi
-}
-
-assert_arg "${SUBJECT:-}" '-s SUBJECT'
-assert_arg "${1:-}" 'ADDRESS'
+eval "$(assert-arg "${SUBJECT:-}" '-s SUBJECT')"
+eval "$(assert-arg "${1:-}" 'ADDRESS')"
printf 'Subject: %s\n\n%s' \
"$(echo "$SUBJECT" | tr -d '\n')" \