diff options
author | EuAndreh <eu@euandre.org> | 2022-08-13 10:58:10 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-08-13 10:58:10 -0300 |
commit | a0188f38d8a9702dd3d7119375173d063a5f28bc (patch) | |
tree | 3ff6e25d0125cef5d7d7db0a7ace05a71d586166 /bin/msg | |
parent | bin/httpno: Add working utility (diff) | |
download | dotfiles-a0188f38d8a9702dd3d7119375173d063a5f28bc.tar.gz dotfiles-a0188f38d8a9702dd3d7119375173d063a5f28bc.tar.xz |
bin/: Replace usage of assert_arg with assert-arg
Diffstat (limited to 'bin/msg')
-rwxr-xr-x | bin/msg | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -124,31 +124,23 @@ fi MESSAGE="${1:-}" -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s.\n\n' "$2" >&2 - usage >&2 - exit 2 - fi -} - if [ "$XMPP" = true ]; then - assert_arg "$MESSAGE" '-X MESSAGE' + eval "$(assert-arg "$MESSAGE" '-X MESSAGE')" xmpp -m "$MESSAGE" eu@euandreh.xyz & fi if [ "$SOUND" = true ]; then sound & fi if [ "$SPEAK" = true ]; then - assert_arg "$MESSAGE" '-S MESSAGE' + eval "$(assert-arg "$MESSAGE" '-S MESSAGE')" echo "$MESSAGE" | speak -v pt-BR & fi if [ "$MAIL" = true ]; then - assert_arg "$MESSAGE" '-m MESSAGE' + eval "$(assert-arg "$MESSAGE" '-m MESSAGE')" echo " " | email -s "$MESSAGE" eu@euandre.org & fi if [ "$DESKTOP" = true ]; then - assert_arg "$MESSAGE" '-D MESSAGE' + eval "$(assert-arg "$MESSAGE" '-D MESSAGE')" if [ "$OK" = true ]; then notify-send -t 5000 "$MESSAGE" & else |