File: edit.indent.rc

package info (click to toggle)
mc 3%3A4.8.26-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 23,416 kB
  • sloc: ansic: 115,748; sh: 7,993; perl: 3,058; makefile: 1,633; python: 410; lisp: 44; cs: 44; sed: 16
file content (31 lines) | stat: -rwxr-xr-x 788 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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