aboutsummaryrefslogtreecommitdiff
path: root/scripts/indent
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-31 14:37:15 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-31 14:37:15 +0800
commit6a36c1543b30838da69c37ff8ee2a0207efbf20d (patch)
tree1e88029a669dc94feee4b76cf9eb82c378acacfb /scripts/indent
parentUse FreeBSD kernel normal form for C source (diff)
downloadforge-6a36c1543b30838da69c37ff8ee2a0207efbf20d.tar.gz
forge-6a36c1543b30838da69c37ff8ee2a0207efbf20d.tar.zst
forge-6a36c1543b30838da69c37ff8ee2a0207efbf20d.zip
Add an auto-indent script
Diffstat (limited to 'scripts/indent')
-rwxr-xr-xscripts/indent11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/indent b/scripts/indent
new file mode 100755
index 0000000..1693aff
--- /dev/null
+++ b/scripts/indent
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -eu
+
+if [ x"$(indent --version)" != x'FreeBSD indent 2.0' ]
+then
+ printf 'indent(1) version mismatch\n' >&2
+ exit 1
+fi
+
+find . -name '*.c' -exec indent '{}' ';'