add gensrc csh script in order to generate src.conf options
authorSofian Brabez <sbz@6dev.net>
Wed, 13 Apr 2016 20:23:33 +0000 (22:23 +0200)
committersbz <sbz@6dev.net>
Wed, 13 Apr 2016 20:23:33 +0000 (22:23 +0200)
gensrc [new file with mode: 0755]

diff --git a/gensrc b/gensrc
new file mode 100755 (executable)
index 0000000..d4141ce
--- /dev/null
+++ b/gensrc
@@ -0,0 +1,17 @@
+#!/bin/csh
+
+if (${?argv} == 0) then
+    printf "%s\n" "Usage: gensrc with or without"
+    exit
+endif
+
+switch ($argv[1])
+case without:
+    zgrep 'WITHOUT' /usr/share/man/man5/src.conf.5.gz | sed -n 's/.*\(WITHOUT_[^ ]*\).*$/\1/p' | sort -u
+    breaksw
+case with:
+    zgrep 'WITH' /usr/share/man/man5/src.conf.5.gz | sed -n 's/.*\(WITH_[^ ]*\).*$/\1/p' | sort -u
+    breaksw
+default:
+    printf "%s\n" "Usage: gensrc with or without"
+endsw