| 1 |
#!/usr/bin/env python |
| 2 |
|
| 3 |
from __future__ import print_function |
| 4 |
|
| 5 |
tokens = [] |
| 6 |
with open("makensiscmdhelp.output") as f: # output from `makensis /cmdhelp` |
| 7 |
for line in f: |
| 8 |
if line.startswith(" "): |
| 9 |
continue # line continuation |
| 10 |
|
| 11 |
tokens.append(line.split()[0]) |
| 12 |
|
| 13 |
keywords = [x[1:] for x in tokens if x.startswith("!")] |
| 14 |
basefuncs = [x for x in tokens if not x.startswith("!")] |
| 15 |
|
| 16 |
print("KEYWORDS") |
| 17 |
for keyword in keywords: |
| 18 |
print("<item> %s </item>" % keyword) |
| 19 |
print() |
| 20 |
|
| 21 |
print("BASEFUNCS") |
| 22 |
for basefunc in basefuncs: |
| 23 |
print("<item> %s </item>" % basefunc) |