minecraft-bot/print_help.py
2021-04-19 04:18:40 +00:00

17 lines
411 B
Python

HELP_LINES = []
with open('game.py', 'r') as f:
for line in f.readlines():
if line.strip().startswith('## '):
HELP_LINES.append(line.strip()[3:])
if __name__ == '__main__':
for line in HELP_LINES:
if ' - ' in line:
command, doc = line.split(' - ')
print('`{}` - {}\n'.format(command, doc))
else:
print(line)
print()