Added list_vars.sh to easily enumerate exported variables from source
[mirrors/libpurple-core-answerscripts.git] / list_vars.sh
diff --git a/list_vars.sh b/list_vars.sh
new file mode 100755 (executable)
index 0000000..41e633c
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+file='answerscripts.c'
+pipe=cat
+[ -n "$1" ] && pipe='sed -e s/_/\\_/g'
+pre="$(grep ENV_PREFIX "$file" | head -n 1 | cut -d '"' -f 2)"
+grep setenv "$file" | while read line; do
+  var="$(echo "$line" | cut -d '"' -f 2)";
+  wtf="$(echo "$line" | cut -d ';' -f 2 | cut -d '/' -f 3-)";
+       echo -n "$1* $pre$var";
+       [ -n "$wtf" ] && echo -e "\t($wtf)" || echo
+done | $pipe
This page took 0.103806 seconds and 4 git commands to generate.