]> jfr.im git - yt-dlp.git/blame - devscripts/make_readme.py
devscripts/make_readme.py in place of all that sedding, that has porting problems
[yt-dlp.git] / devscripts / make_readme.py
CommitLineData
4bb028f4
FV
1import sys
2import re
3
4helptext = sys.stdin.read()
5
6f = open('README.md')
7oldreadme = f.read()
8f.close()
9
10header = oldreadme[:oldreadme.index('# OPTIONS')]
11footer = oldreadme[oldreadme.index('# CONFIGURATION'):]
12
13options = helptext[helptext.index(' General Options:')+19:]
14options = re.sub(r'^ (\w.+)$', r'## \1', options, flags=re.M)
15options = '# OPTIONS\n' + options + '\n'
16
17f = open('README.md', 'w')
18f.write(header)
19f.write(options)
20f.write(footer)
21f.close()