docs
[pspp] / doc / get-commands.py
1 #! /usr/bin/python3
2 # Creates Texinfo documentation from the source
3
4 import re
5 import sys
6
7 print("""\
8 @c Generated from %s by get-commands.py
9 @c Do not modify!
10
11 @table @asis""" % sys.argv[1])
12 for line in open(sys.argv[1], 'r'):
13     m = re.match(r'^\s*UNIMPL_CMD\s*\(\s*"([^"]*)"\s*,\s*"([^"]*)"\)\s*$', line)
14     if m:
15         command, description = m.groups()
16         print("@item @cmd{%s}\n%s\n" % (command, description))
17 print("""\
18 @end table
19 @c Local Variables:
20 @c buffer-read-only: t
21 @c End:""")
22