mc/contrib/edit.indent.rc
Mikhail S. Pobolovets a55a505160 Move all stuff from lib to contrib
Also added template in contrib/distr for some distro-related files (spec, deb, ebuild, etc)
2009-05-08 15:12:48 +03:00

32 lines
788 B
Bash

#! /bin/sh
# *** External Formatter (Indenter) for GNU Midnight Commander.
# arguments:
# $1 - Name of the file being edited
# $2 - Name of the file to be processed
exec >/dev/null
case `echo $1 |sed 's/^.*\.//'` in
c|h)
# ftp://ftp.gnu.org/pub/gnu/indent/
# Please add options to your ~/.indent.pro, not here.
indent "$2"
;;
C|cc|CC|cxx|CXX|cpp|CPP)
# http://astyle.sourceforge.net/
astyle "$2"
;;
java|JAVA)
# http://astyle.sourceforge.net/
astyle --style=java --mode=java "$2"
;;
htm|html|HTM|HTML)
# http://tidy.sourceforge.net/
tidy -q -m -ascii -wrap 80 "$2"
;;
*)
# http://www.gnu.org/software/coreutils/
fmt "$2" >"$2.tmp" && rm -f "$2" && mv -f "$2.tmp" "$2"
;;
esac