1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/imip_mutt_handler.sh Wed Nov 01 23:27:40 2017 +0100
1.3 @@ -0,0 +1,52 @@
1.4 +#!/bin/sh
1.5 +
1.6 +# Invoke the text client from the Mutt mail client.
1.7 +#
1.8 +# Copyright (C) 2017 Paul Boddie <paul@boddie.org.uk>
1.9 +#
1.10 +# This program is free software; you can redistribute it and/or modify it under
1.11 +# the terms of the GNU General Public License as published by the Free Software
1.12 +# Foundation; either version 3 of the License, or (at your option) any later
1.13 +# version.
1.14 +#
1.15 +# This program is distributed in the hope that it will be useful, but WITHOUT
1.16 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1.17 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1.18 +# details.
1.19 +#
1.20 +# You should have received a copy of the GNU General Public License along with
1.21 +# this program. If not, see <http://www.gnu.org/licenses/>.
1.22 +
1.23 +DIRNAME=`dirname "$0"`
1.24 +PROGNAME=`basename "$0"`
1.25 +
1.26 +if [ "$1" = "--help" ] || [ ! "$1" ]; then
1.27 + cat 1>&2 <<EOF
1.28 +Usage: $PROGNAME <filename> [ <options> ]
1.29 +
1.30 +Handle the calendar data provided in the file with the given filename.
1.31 +Additional options are presented to the client program to override any
1.32 +configuration defaults.
1.33 +
1.34 +Example:
1.35 +
1.36 +$PROGNAME message.txt
1.37 +EOF
1.38 + exit 1
1.39 +fi
1.40 +
1.41 +# Expect a filename for the calendar data
1.42 +
1.43 +INFILE="$1"
1.44 +
1.45 +if [ ! "$INFILE" ] || [ ! -e "$INFILE" ]; then
1.46 + cat 1>&2 <<EOF
1.47 +Need an input file containing a calendar object.
1.48 +EOF
1.49 +fi
1.50 +
1.51 +shift 1
1.52 +
1.53 +# Invoke the client to show the incoming object details.
1.54 +
1.55 +"$DIRNAME/imip_text_client.py" -f "$INFILE" --handle-data $@