tools/textviewer.sh
authorLuke Plant <L.Plant.98@cantab.net>
Mon, 5 Jan 2004 16:08:12 +0000 (16:08 +0000)
committerLuke Plant <L.Plant.98@cantab.net>
Mon, 5 Jan 2004 16:08:12 +0000 (16:08 +0000)
o added a viewer for OpenOffice writer files (ooo2txt)

tools/textviewer.sh

index 85d3800..075c025 100644 (file)
 # Change Log
 #
 # 2004-01-05
+#      - added matcher and action for OpenOffice Writer documents
+#        (requires ooo2txt)
+#
+# 2004-01-05
 #      - changed page width parameter for antiword
 #      - fixed matcher for 'diffs'
 #      - added a matcher and action for bzip2 - bzip2 files
@@ -98,6 +102,7 @@ case "$1" in
        *.diff) TYPE=TEXT       ;;
        *.txt)  TYPE=TEXT       ;;
        *.rtf)  TYPE=RTF        ;;
+       *.sxw)  TYPE=OOWRITER   ;;
 esac
 
 if [ "$TYPE" == "" ]   
@@ -155,5 +160,12 @@ case $TYPE in
                };
                antiword -w 72 "$1"                             ;;
 
+       OOWRITER) which ooo2txt > /dev/null 2>&1 ||
+               {
+                       echo "Program 'ooo2txt' for converting OpenOffice Writer files not files not found" >&2
+                       exit 1
+               };
+               ooo2txt "$1"                                    ;;
+
        *)      echo "Unsupported file type \"$FILETYPE\", cannot display.";;
 esac