1 #!/bin/sh 2 3 # Invoke the text client from the Mutt mail client. 4 # 5 # Copyright (C) 2017 Paul Boddie <paul@boddie.org.uk> 6 # 7 # This program is free software; you can redistribute it and/or modify it under 8 # the terms of the GNU General Public License as published by the Free Software 9 # Foundation; either version 3 of the License, or (at your option) any later 10 # version. 11 # 12 # This program is distributed in the hope that it will be useful, but WITHOUT 13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 15 # details. 16 # 17 # You should have received a copy of the GNU General Public License along with 18 # this program. If not, see <http://www.gnu.org/licenses/>. 19 20 DIRNAME=`dirname "$0"` 21 PROGNAME=`basename "$0"` 22 23 if [ "$1" = "--help" ] || [ ! "$1" ]; then 24 cat 1>&2 <<EOF 25 Usage: $PROGNAME <filename> [ <options> ] 26 27 Handle the calendar data provided in the file with the given filename. 28 Additional options are presented to the client program to override any 29 configuration defaults. 30 31 Example: 32 33 $PROGNAME message.txt 34 EOF 35 exit 1 36 fi 37 38 # Expect a filename for the calendar data 39 40 INFILE="$1" 41 42 if [ ! "$INFILE" ] || [ ! -e "$INFILE" ]; then 43 cat 1>&2 <<EOF 44 Need an input file containing a calendar object. 45 EOF 46 fi 47 48 shift 1 49 50 # Invoke the client to show the incoming object details. 51 52 "$DIRNAME/imip_text_client.py" -f "$INFILE" --handle-data $@