#!/usr/bin/env python
# -*- coding: utf-8 -*-

import argparse
import sys
from psas_packet import messages

parser = argparse.ArgumentParser(prog='gen-psas-types')
parser.add_argument('-f', '--file', type=argparse.FileType('w'),
                    default=sys.stdout,
                    help="header file to write to")
args = vars(parser.parse_args())

output = args['file']
output.write("""/**
 * DO NOT EDIT THIS FILE
 *
 * It is automatically generated by <https://github.com/psas/packet-serializer>
 * See documentation <http://psas-packet-serializer.readthedocs.org/en/latest/>
 */


""")

for message in messages.PSAS_MESSAGES:
    output.write(message.typedef())
    output.write('\n\n')

output.close()
