]> git.ipfire.org Git - thirdparty/systemd.git/blob - tools/find-tabs.sh
e32eac8f3297848bc3692ec26a01e02b2d1a6685
[thirdparty/systemd.git] / tools / find-tabs.sh
1 #!/bin/sh
2 # SPDX-License-Identifier: LGPL-2.1+
3
4 TOP=`git rev-parse --show-toplevel`
5
6 case "$1" in
7
8 recdiff)
9 if [ "$2" = "" ] ; then
10 DIR="$TOP"
11 else
12 DIR="$2"
13 fi
14
15 find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 diff \{\} \;
16 ;;
17
18 recpatch)
19 if [ "$2" = "" ] ; then
20 DIR="$TOP"
21 else
22 DIR="$2"
23 fi
24
25 find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 patch \{\} \;
26 ;;
27
28 diff)
29 T=`mktemp`
30 sed 's/\t/ /g' < "$2" > "$T"
31 diff -u "$2" "$T"
32 rm -f "$T"
33 ;;
34
35 patch)
36 sed -i 's/\t/ /g' "$2"
37 ;;
38
39 *)
40 echo "Expected recdiff|recpatch|diff|patch as verb." >&2
41 ;;
42 esac