1. Cameron Simpson
  2. css

Commits

Cameron Simpson  committed de19bdc

alert: add +D to suppress dlog backend, using to aovid feedback loops relaying remote alerts

  • Participants
  • Parent commits eb87416
  • Branches default

Comments (0)

Files changed (1)

File bin/alert

View file
 usage="Usage: $cmd [-c colour] [-G] [-s subtitle] [-t title] {-|echo-args...]}"
 
 colour=
+dlog=1
 growl=
 tnotify=
 title=
 do
   case $1 in
     -c) colour=$2; shift ;;
+    -D) dlog=1 ;;
+    +D) dlog= ;;
     -G) growl=1 ;;
     +G) growl= ;;
     -t) title=$2; shift ;;
 else  echo "$*"
 fi >>"$ALERTLOG" || xit=1
 
-dlog "ALERT: $*"
+[ $dlog ] && dlog "ALERT: $*"
 
 if [ $growl ]
 then