Commit Diff


commit - 58ba28617d6a6c7b73a4585739f8e0b7764de27b
commit + e777653d7ac97be5c9193561a3d40b4897a2ed37
blob - /dev/null
blob + aa6ac2cda9e2bb4b14a7052aa3f67f8a185fc545 (mode 755)
--- /dev/null
+++ .local/bin/fmtconf
@@ -0,0 +1,14 @@
+#!/usr/bin/awk -f
+{
+	gsub(/^[ \t]+|[ \t]+$/, "")
+
+	if ($0 == "") { print ""; next }
+	
+	if ($0 ~ /^}/) depth--
+	if (depth < 0) depth = 0
+	
+	for (i = 0; i < depth; i++) printf "\t"
+	print
+	
+	if ($0 ~ /\{$/) depth++
+}