[GRASS-SVN] r32399 - grass/trunk/tools
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 31 07:19:06 EDT 2008
Author: neteler
Date: 2008-07-31 07:19:05 -0400 (Thu, 31 Jul 2008)
New Revision: 32399
Added:
grass/trunk/tools/grass_indent.sh
grass/trunk/tools/grass_indent_ALL.sh
Log:
convenient scripts to indent GRASS code
Added: grass/trunk/tools/grass_indent.sh
===================================================================
--- grass/trunk/tools/grass_indent.sh (rev 0)
+++ grass/trunk/tools/grass_indent.sh 2008-07-31 11:19:05 UTC (rev 32399)
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Indent source code according to GRASS SUBMITTING rules
+
+if [ $# -lt 1 ] ; then
+ echo "No files specified (give file name(s) as parameter)"
+ exit 1
+else
+ indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \
+ -nbbo -nbc -nbfda -nbfde -ncdb -ncdw -nce -nfca -npcs -nprs \
+ -npsl -nsc -nsob -saf -sai -saw -sbi0 -ss -ts8 -ut $@
+fi
Property changes on: grass/trunk/tools/grass_indent.sh
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Added: grass/trunk/tools/grass_indent_ALL.sh
===================================================================
--- grass/trunk/tools/grass_indent_ALL.sh (rev 0)
+++ grass/trunk/tools/grass_indent_ALL.sh 2008-07-31 11:19:05 UTC (rev 32399)
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# HANDLE WITH CARE
+# loops over entire GRASS source code tree and indents source code according to SUBMITTING rules
+
+#are we in the tools/ dir? We should not.
+l$ tools 2> /dev/null
+if [ $? -ne 0 ] ; then
+ echo "ERROR: this script must be run from the main GRASS source code directory"
+ exit 1
+fi
+
+echo "Indenting *.c and *.h..."
+find . -type f -name "*.[ch]" | xargs ./tools/grass_indent.sh
+
+echo "Indenting *.cpp..."
+find . -type f -name "*.cpp" | xargs ./tools/grass_indent.sh
+
+echo "Indenting *.cc..."
+find . -type f -name "*.cc" | xargs ./tools/grass_indent.sh
+
Property changes on: grass/trunk/tools/grass_indent_ALL.sh
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
More information about the grass-commit
mailing list