Add reindent-allman.sh
authorHugo Villeneuve <hugo@hugovil.com>
Fri, 3 Dec 2021 19:03:21 +0000 (14:03 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Fri, 3 Dec 2021 19:03:27 +0000 (14:03 -0500)
scripts/Makefile.am
scripts/reindent-allman.sh [new file with mode: 0644]

index 9379273..b885496 100644 (file)
@@ -32,6 +32,7 @@ dist_bin_SCRIPTS = \
     git-project-tag.sh \
     git-project-gitk.sh \
     source-code-stats \
+    reindent-allman.sh \
     flac2ogg flac2mp3 \
     hv-scan \
     hvpdf-rotate \
diff --git a/scripts/reindent-allman.sh b/scripts/reindent-allman.sh
new file mode 100644 (file)
index 0000000..b301048
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+ASTYLE=`which astyle`
+OPTIONS="--style=allman \
+    --mode=c \
+    --indent=spaces=4 \
+    --pad-oper \
+    --align-pointer=name \
+    --pad-header \
+    --min-conditional-indent=0 \
+    --indent-col1-comments \
+    --convert-tabs \
+    --recursive \
+    --suffix=none"
+
+${ASTYLE} ${OPTIONS} "*.c"
+${ASTYLE} ${OPTIONS} "*.cpp"
+${ASTYLE} ${OPTIONS} "*.h"
+${ASTYLE} ${OPTIONS} "*.hpp"