]> granicus.if.org Git - pgbouncer/commitdiff
etc/optscan.sh - show undocumented options
authorMarko Kreen <markokr@gmail.com>
Mon, 27 Jul 2015 08:34:26 +0000 (11:34 +0300)
committerMarko Kreen <markokr@gmail.com>
Mon, 27 Jul 2015 08:34:26 +0000 (11:34 +0300)
etc/optscan.sh [new file with mode: 0755]

diff --git a/etc/optscan.sh b/etc/optscan.sh
new file mode 100755 (executable)
index 0000000..f18b77c
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+# Check if all options in main.c are defined in sample ini and docs
+
+sources="src/main.c"
+targets="doc/config.txt etc/pgbouncer.ini"
+
+for opt in `grep CF_ABS "$sources" | sed -r 's/^[^"]*"([^"]*)".*/\1/'`; do
+  for conf in $targets; do
+    if ! grep -q "$opt" "$conf"; then
+      echo "$opt is missing in $conf"
+    fi
+  done
+done
+
+