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