#!/usr/bin/env python3 import sys DOC_HEADER = ''' {0} {0} {0} enum {1} {1} {1} Values ''' DOC_ENUM = ''' {0} = {1} ''' DOC_FOOTER = ''' ''' if __name__ == '__main__': if len(sys.argv) >= 4: with open(sys.argv[1], 'w') as doc_out: enum_name = sys.argv[2] enum_type = sys.argv[3] doc_out.write(DOC_HEADER.format(enum_name, enum_type)) for i, enum in enumerate(sys.argv[4:]): doc_out.write(DOC_ENUM.format(enum, i)) doc_out.write(DOC_FOOTER) else: print('Use: ' + sys.argv[0] + ' out name type [enums]') sys.exit(0)