X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=reindent.sh;h=5d6708de1ad270b86e05b89dd704912389b42756;hb=9e1054422fec41c549ab80b8ab9996fb99fc9542;hp=8854f40287fb2c4e6cdd28ef4856f2b27f5a9f4e;hpb=a1533d04cfc62bf5b0c36475f33ec10cd30a8976;p=kdenlive diff --git a/reindent.sh b/reindent.sh index 8854f402..5d6708de 100755 --- a/reindent.sh +++ b/reindent.sh @@ -1,7 +1,28 @@ #! /bin/sh -for i in `ls src/*.{cpp,h}` -do - indent -kr -nut -pmt -ss -bad -bap -prs -bap -nbc -nce -cdb -fca $i - sed -e "s/} const const/}const/" -i $i -done \ No newline at end of file +WRKDIR=$(dirname $0) +SRCDIRS="$WRKDIR/src $WRKDIR/plugins $WRKDIR/renderer $WRKDIR/thumbnailer" + +if [ $# -gt 0 ] +then + FILES=$@ +else + FILES=$(find $SRCDIRS -type f -name \*.cpp -o -name \*.h) +fi + +astyle --indent=spaces=4 --brackets=linux \ + --indent-labels --unpad=paren \ + --pad=oper --convert-tabs \ + --indent-preprocessor \ + ${FILES} + +echo -n "Delete .orig files (y/N) ? " +read del + +if [ "x${del}" = "xy" ] +then + echo "removing .orig files" + find $SRCDIRS -iname "*.orig" -exec rm {} ";" +else + echo "Not deleting .orig files" +fi