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.
20 lines
508 B
20 lines
508 B
4 months ago
|
import sdk_pb2
|
||
|
import sys
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
argv = sys.argv[1:]
|
||
|
if not len(argv) == 4 or sorted([argv[0], argv[2]]) != ['-o', '-v']:
|
||
|
print('usage: gen_sdkinfo -v <version> -o <output-file>')
|
||
|
sys.exit(1)
|
||
|
|
||
|
for i in range(len(argv)):
|
||
|
if sys.argv[i] == '-o':
|
||
|
filename = sys.argv[i+1]
|
||
|
if sys.argv[i] == '-v':
|
||
|
version = int(sys.argv[i+1])
|
||
|
|
||
|
proto = sdk_pb2.SdkVersion()
|
||
|
proto.version = version
|
||
|
with open(filename, 'wb') as f:
|
||
|
f.write(proto.SerializeToString())
|