Revert "Enable the wincred credential helper by default for Windows users."
[msysgit.git] / bin / astextplain
blob76fa94a3d194f7be215c5ea955500874ff6688a5
1 #!/bin/sh -e
2 # minimalistic replacement for `run-mailcap --action=cat <file>`
4 if test "$#" != 1 ; then
5 echo "Usage: astextplain <file>" 1>&2
6 exit 1
7 fi
9 # XXX output encoding (UTF-8) hardcoded
10 case "$1" in
11 *.doc | *.DOC | *.dot | *.DOT)
12 antiword -m UTF-8 "$1" || cat "$1"
14 *.docx | *.DOCX)
15 docx2txt "$1" -
17 *.pdf | *.PDF)
18 pdftotext -layout "$1" -enc UTF-8 -
20 # TODO add rtf support
21 *.rtf | *.RTF)
22 cat "$1"
25 echo "E: unsupported filetype $1" 1>&2
26 exit 1
28 esac
30 exit 0