File: indent.sh

package info (click to toggle)
lcd4linux 0.11.0~svn1189-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,260 kB
  • sloc: ansic: 36,109; sh: 4,479; makefile: 192; python: 83; perl: 33
file content (20 lines) | stat: -rwxr-xr-x 492 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/bash

# $Id: indent.sh 1136 2010-11-28 16:07:16Z mzuther $
# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/indent.sh $


# -kr    Use Kernighan & Ritchie coding style.
# -l120  Set maximum line length for non-comment lines to 150.
# -npro  Do not read ‘.indent.pro’ files.

rm *.c~ *.h~ 2>/dev/null  # trash "no such file or directory" warning messages 
indent -kr -l120 -npro *.c *.h

for i in *.c *.h; do
  if !(diff -q $i $i~); then
    rm $i~
  else
    mv $i~ $i
  fi
done