Convert all Perl build tools to Python and remove Perl build dependency.
[pspp] / doc / get-commands.py
diff --git a/doc/get-commands.py b/doc/get-commands.py
new file mode 100644 (file)
index 0000000..fa6b98e
--- /dev/null
@@ -0,0 +1,22 @@
+#! /usr/bin/python3
+# Creates Texinfo documentation from the source
+
+import re
+import sys
+
+print("""\
+@c Generated from %s by get-commands.py
+@c Do not modify!
+
+@table @asis""" % sys.argv[1])
+for line in open(sys.argv[1], 'r'):
+    m = re.match(r'^\s*UNIMPL_CMD\s*\(\s*"([^"]*)"\s*,\s*"([^"]*)"\)\s*$', line)
+    if m:
+        command, description = m.groups()
+        print("@item @cmd{%s}\n%s\n" % (command, description))
+print("""\
+@end table
+@c Local Variables:
+@c buffer-read-only: t
+@c End:""")
+