The Meson Build System
http://mesonbuild.com/
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.
22 lines
606 B
22 lines
606 B
9 years ago
|
#!/usr/bin/env python3
|
||
11 years ago
|
|
||
8 years ago
|
import os
|
||
11 years ago
|
import sys
|
||
|
|
||
8 years ago
|
assert(os.path.exists(sys.argv[3]))
|
||
|
|
||
|
args = sys.argv[:-1]
|
||
|
|
||
11 years ago
|
if __name__ == '__main__':
|
||
8 years ago
|
if len(args) != 3 or not args[1].startswith('--input') or \
|
||
|
not args[2].startswith('--output'):
|
||
|
print(args[0], '--input=input_file --output=output_file')
|
||
11 years ago
|
sys.exit(1)
|
||
8 years ago
|
with open(args[1].split('=')[1]) as f:
|
||
8 years ago
|
ifile = f.read()
|
||
11 years ago
|
if ifile != 'This is a text only input file.\n':
|
||
|
print('Malformed input')
|
||
|
sys.exit(1)
|
||
8 years ago
|
with open(args[2].split('=')[1], 'w') as ofile:
|
||
8 years ago
|
ofile.write('This is a binary output file.\n')
|