basesrc: use segment start if DTS for first buffer is unset
[platform/upstream/gstreamer.git] / tools / gst-indent
1 #!/bin/sh
2
3 version=`gnuindent --version 2>/dev/null`
4 if test "x$version" = "x"; then
5   version=`indent --version 2>/dev/null`
6   if test "x$version" = "x"; then
7     echo "GStreamer git pre-commit hook:"
8     echo "Did not find GNU indent, please install it before continuing."
9     exit 1
10   fi
11   INDENT=indent
12 else
13   INDENT=gnuindent
14 fi
15
16 case `$INDENT --version` in
17   GNU*)
18       ;;
19   default)
20       echo "Did not find GNU indent, please install it before continuing."
21       echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
22       exit 1
23       ;;
24 esac
25
26 $INDENT \
27   --braces-on-if-line \
28   --case-brace-indentation0 \
29   --case-indentation2 \
30   --braces-after-struct-decl-line \
31   --line-length80 \
32   --no-tabs \
33   --cuddle-else \
34   --dont-line-up-parentheses \
35   --continuation-indentation4 \
36   --honour-newlines \
37   --tab-size8 \
38   --indent-level2 \
39   --leave-preprocessor-space \
40   $*