OLD | NEW |
| (Empty) |
1 #!/usr/bin/env python | |
2 # Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | |
3 # for details. All rights reserved. Use of this source code is governed by a | |
4 # BSD-style license that can be found in the LICENSE file. | |
5 | |
6 from optparse import OptionParser | |
7 | |
8 def writePatch(output_file_name, input_file_names): | |
9 dart_file_names = filter(lambda name: name.endswith('.dart'), | |
10 input_file_names) | |
11 with open(output_file_name, 'w') as output_file: | |
12 for dart_file_name in dart_file_names: | |
13 with open(dart_file_name, 'r') as dart_file: | |
14 output_file.write(dart_file.read()) | |
15 | |
16 | |
17 def main(): | |
18 parser = OptionParser() | |
19 parser.add_option('--output', action='store', type='string', | |
20 help='output file path') | |
21 (options, args) = parser.parse_args() | |
22 if not options.output: | |
23 parser.error('missing --output option\n') | |
24 if len(args) == 0: | |
25 parser.error('no input files given\n') | |
26 writePatch(options.output, args) | |
27 | |
28 | |
29 if __name__ == '__main__': | |
30 main() | |
OLD | NEW |