You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

16 lines
422 B

HELP_LINES = []
with open('mosfet/commands.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()