4 README_FILE = 'README.md'
5 helptext = sys.stdin.read()
7 with open(README_FILE) as f:
10 header = oldreadme[:oldreadme.index('# OPTIONS')]
11 footer = oldreadme[oldreadme.index('# CONFIGURATION'):]
13 options = helptext[helptext.index(' General Options:')+19:]
14 options = re.sub(r'^ (\w.+)$', r'## \1', options, flags=re.M)
15 options = '# OPTIONS\n' + options + '\n'
17 with open(README_FILE, 'w') as f: