Add reindent-linux.sh
authorHugo Villeneuve <hugo@hugovil.com>
Wed, 20 Nov 2024 18:58:34 +0000 (13:58 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 20 Nov 2024 20:53:12 +0000 (15:53 -0500)
scripts/Makefile.am
scripts/reindent-linux.sh [new file with mode: 0644]

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