diff --git a/src/protocol/generate_protocol.py b/src/protocol/generate_protocol.py index cf35f54..a0eb4bc 100644 --- a/src/protocol/generate_protocol.py +++ b/src/protocol/generate_protocol.py @@ -69,8 +69,8 @@ def print_protocol(): True) def main(): - if len(sys.argv) != 2: - print('Please specify the input file.') + if len(sys.argv) != 3: + print('Usage: generate_protocol.py ') return add_text('#pragma once') @@ -84,7 +84,7 @@ def main(): add_text('}}') add_text('') - with open('ProtocolDefinitions.h', 'w') as out_file: + with open(sys.argv[2], 'w') as out_file: out_file.write(text) out_file.close() diff --git a/src/protocol/meson.build b/src/protocol/meson.build index a3f48d7..da7be9d 100644 --- a/src/protocol/meson.build +++ b/src/protocol/meson.build @@ -1,4 +1,4 @@ protocol_headers = custom_target('ProtocolHeader', input : [ 'generate_protocol.py', 'protocol.hjson' ], output : [ 'ProtocolDefinitions.h' ], - command : [ python, '@INPUT@' ]) \ No newline at end of file + command : [ python, '@INPUT@', '@OUTPUT@' ]) \ No newline at end of file