#!/bin/bash

##
# This file is part of the CASITA software
#
# Copyright (c) 2013-2014,
# Technische Universitaet Dresden, Germany
#
# This software may be modified and distributed under the terms of
# a BSD-style license. See the COPYING file in the package base
# directory for details.
#
##

command -v uncrustify

if [ $? -gt 0 ]; then
    echo "uncrustify not found"
    exit 1
fi

EXTENSIONS="*.cpp *.hpp"

for EXT in $EXTENSIONS; do
    find . -name $EXT -exec echo -e "beautifying {}" \; -exec uncrustify -c casita_uncrustify.cfg --replace --no-backup -q '{}' \;
done
