]> diplodocus.org Git - nmh/blobdiff - docs/contrib/replaliases
Added -attendee switch to mhical(1).
[nmh] / docs / contrib / replaliases
index efc249c..077965c 100644 (file)
@@ -19,6 +19,7 @@ if [ -z "$PARINIT" ]; then
     export PARINIT
 fi
 
+
 #### Reply, including text/html (converted to text/plain) and
 #### text/plain parts.
 ####
@@ -57,24 +58,75 @@ rtm() {
 }
 
 
+#### Internal function for use by calendar response functions below.
+#### Pulls "-a address" out of command line arguments.
+mhical_attendee() {
+    mhical_prev=
+    mhical_attendee=
+    for arg in "$@"; do
+        test "$mhical_prev" = -a  &&  mhical_attendee="$arg"
+        mhical_prev="$arg"
+    done
+    unset arg
+    unset mhical_prev
+    echo "$mhical_attendee"
+}
+
+
 #### accept a calendar request
+#### usage: calaccept [-a address] [repl switches]
+####   -a specifies attendee, see mhical(1)
+#### Other arguments passed to repl(1).
 calaccept() {
+    if [ "$1" = -a ]; then
+        attendee=' -attendee '`mhical_attendee "$@"`
+        shift; shift
+    else
+        attendee=
+    fi
     \repl -noformat -editor mhbuild \
-         -convertargs text/calendar '-reply accept -contenttype' "$@"
+          -convertargs text/calendar "-reply accept -contenttype${attendee}" \
+          "$@"
+    unset attendee
 }
 
+
 #### decline a calendar request
+#### usage: caldecline [-a address] [repl switches]
+####   -a specifies attendee, see mhical(1)
+#### Other arguments passed to repl(1).
 caldecline() {
+    if [ "$1" = -a ]; then
+        attendee=' -attendee '`mhical_attendee "$@"`
+        shift; shift
+    else
+        attendee=
+    fi
     \repl -noformat -editor mhbuild \
-         -convertargs text/calendar '-reply decline -contenttype' "$@"
+          -convertargs text/calendar "-reply decline -contenttype${attendee}" \
+          "$@"
+    unset attendee
 }
 
+
 #### reply as tentative to a calendar request
+#### usage: caltentative [-a address] [repl switches]
+####   -a specifies attendee, see mhical(1)
+#### Other arguments passed to repl(1).
 caltentative() {
+    if [ "$1" = -a ]; then
+        attendee=' -attendee '`mhical_attendee "$@"`
+        shift; shift
+    else
+        attendee=
+    fi
     \repl -noformat -editor mhbuild \
-         -convertargs text/calendar '-reply tentative -contenttype' "$@"
+          -convertargs text/calendar "-reply tentative -contenttype${attendee}" \
+          "$@"
+    unset attendee
 }
 
+
 #### cancel a calendar request
 calcancel() {
     \repl -noformat -editor mhbuild \