File: get-commands.py

package info (click to toggle)
pspp 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 66,676 kB
  • sloc: ansic: 267,210; xml: 18,446; sh: 5,534; python: 2,881; makefile: 125; perl: 64
file content (22 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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:""")