#!/bin/sh -e
# shellcheck disable=SC2312

# [ -z "$2" ] &&
#   notify "$($1)" ||
#     notify "$1" "$(exec $2)"

case "$#" in
  0)
    printf '%s\n' "$(basename "$0") <subject> [cmd]"
    exit 1
    ;;
  1)
    notify "$($1)"
    ;;
  2)
    notify "$1" "$(exec "$2")"
    ;;
esac
