def main():
    parser = argparse.ArgumentParser(prog='make-pins.py', usage='%(prog)s [options] [command]', description='Generate board specific pin file')
    parser.add_argument('-a', '--af', dest='af_filename', help='Specifies the alternate function file for the chip', default='../chip/SWM3200_port.h')
    parser.add_argument('-p', '--prefix', dest='prefix_filename', help='Specifies beginning portion of generated pins file', default='SWM320_prefix.c')
    parser.add_argument('-q', '--qstr', dest='qstr_filename', help='Specifies name of generated qstr header file', default='../build-SWM320Lite/pins_qstr.h')
    parser.add_argument('-r', '--hdr', dest='hdr_filename', help='Specifies name of generated pin header file', default='../build-SWM320Lite/pins.h')
    args = parser.parse_args(sys.argv[1:])
    pins = Pins()
    print('// This file was automatically generated by make-pins.py')
    print('//')
    if args.af_filename:
        print('// --af {:s}'.format(args.af_filename))
        pins.parse_af_file(args.af_filename)
    if args.prefix_filename:
        print('// --prefix {:s}'.format(args.prefix_filename))
        print('')
        with open(args.prefix_filename, 'r') as prefix_file:
            print(prefix_file.read())
    pins.print()
    pins.print_qstr(args.qstr_filename)
    pins.print_header(args.hdr_filename)
def main():
    parser = argparse.ArgumentParser(prog='make-pins.py', usage='%(prog)s [options] [command]', description='Generate board specific pin file')
    parser.add_argument('-a', '--af', dest='af_filename', help='Specifies the alternate function file for the chip', default='../chip/SWM3200_port.h')
    parser.add_argument('-p', '--prefix', dest='prefix_filename', help='Specifies beginning portion of generated pins file', default='SWM320_prefix.c')
    parser.add_argument('-q', '--qstr', dest='qstr_filename', help='Specifies name of generated qstr header file', default='../build-SWM320Lite/pins_qstr.h')
    parser.add_argument('-r', '--hdr', dest='hdr_filename', help='Specifies name of generated pin header file', default='../build-SWM320Lite/pins.h')
    args = parser.parse_args(sys.argv[1:])
    pins = Pins()
    print('// This file was automatically generated by make-pins.py')
    print('//')
    if args.af_filename:
        print('// --af {:s}'.format(args.af_filename))
        pins.parse_af_file(args.af_filename)
    if args.prefix_filename:
        print('// --prefix {:s}'.format(args.prefix_filename))
        print()
        with open(args.prefix_filename, 'r') as prefix_file:
            print(prefix_file.read())
    pins.print()
    pins.print_qstr(args.qstr_filename)
    pins.print_header(args.hdr_filename)