summaryrefslogtreecommitdiffstats
path: root/misc/edit.indent.rc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:22:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:22:03 +0000
commitffccd5b2b05243e7976db80f90f453dccfae9886 (patch)
tree39a43152d27f7390d8f7a6fb276fa6887f87c6e8 /misc/edit.indent.rc
parentInitial commit. (diff)
downloadmc-ffccd5b2b05243e7976db80f90f453dccfae9886.tar.xz
mc-ffccd5b2b05243e7976db80f90f453dccfae9886.zip
Adding upstream version 3:4.8.30.upstream/3%4.8.30
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'misc/edit.indent.rc')
-rwxr-xr-xmisc/edit.indent.rc31
1 files changed, 31 insertions, 0 deletions
diff --git a/misc/edit.indent.rc b/misc/edit.indent.rc
new file mode 100755
index 0000000..92f82d5
--- /dev/null
+++ b/misc/edit.indent.rc
@@ -0,0 +1,31 @@
+#! /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