From 6c3955231689831ebe7a8b59bd63ff51d175e7a6 Mon Sep 17 00:00:00 2001 From: kc8apf Date: Tue, 3 Feb 2009 04:27:48 +0000 Subject: Add uncrustify config file and helper script git-svn-id: svn://svn.berlios.de/openocd/trunk@1364 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- tools/uncrustify1.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 tools/uncrustify1.sh (limited to 'tools') diff --git a/tools/uncrustify1.sh b/tools/uncrustify1.sh new file mode 100755 index 00000000..c301ec79 --- /dev/null +++ b/tools/uncrustify1.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Run the beautifier "Uncrustify" on a single file. +# Because the file "uncrustify.cfg" only exists in the top level of the project +# you should run this script from there so this script can find your uncrustify.cfg file. + + +UNCRUSTIFYTMP=/tmp/uncrustify.tmp + + +if [ ! -f uncrustify.cfg ]; then + echo "unable to find uncrustify.cfg, aborting" + exit 1 +fi + +UNCRUSTIFYBIN=`which uncrustify` + +if [ "$UNCRUSTIFYBIN" = "" ]; then + echo "you must specify uncrustify in your PATH, I cannot find it" + exit 2 +fi + +if [ $# -lt 1 ]; then + echo "Usage $0 " + exit 3 +fi + +uncrustify -c uncrustify.cfg <$1 >$UNCRUSTIFYTMP + +# you can comment this out while tuning the uncrustify.cfg file: +mv $UNCRUSTIFYTMP $1 -- cgit v1.2.3