OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** General options used by the compiler. */ | 5 /** General options used by the compiler. */ |
6 TemplateOptions options; | 6 TemplateOptions options; |
7 | 7 |
8 /** Extracts options from command-line arguments. */ | 8 /** Extracts options from command-line arguments. */ |
9 void parseOptions(List<String> args, var files) { | 9 void parseOptions(List<String> args, var files) { |
10 assert(options == null); | 10 assert(options == null); |
(...skipping 28 matching lines...) Expand all Loading... |
39 * the arguments after the first dart script, if any. | 39 * the arguments after the first dart script, if any. |
40 */ | 40 */ |
41 List<String> childArgs; | 41 List<String> childArgs; |
42 | 42 |
43 TemplateOptions(List<String> args, var files) { | 43 TemplateOptions(List<String> args, var files) { |
44 bool ignoreUnrecognizedFlags = false; | 44 bool ignoreUnrecognizedFlags = false; |
45 bool passedLibDir = false; | 45 bool passedLibDir = false; |
46 childArgs = []; | 46 childArgs = []; |
47 | 47 |
48 // Start from 2 to skip arguments representing the compiler command | 48 // Start from 2 to skip arguments representing the compiler command |
49 // (node/python followed by frogsh/frog.py). | 49 // (python followed by frog.py). |
50 loop: for (int i = 2; i < args.length; i++) { | 50 loop: for (int i = 2; i < args.length; i++) { |
51 var arg = args[i]; | 51 var arg = args[i]; |
52 | 52 |
53 switch (arg) { | 53 switch (arg) { |
54 case '--check-only': | 54 case '--check-only': |
55 checkOnly = true; | 55 checkOnly = true; |
56 break; | 56 break; |
57 | 57 |
58 case '--verbose': | 58 case '--verbose': |
59 showInfo = true; | 59 showInfo = true; |
(...skipping 24 matching lines...) Expand all Loading... |
84 break; | 84 break; |
85 | 85 |
86 default: | 86 default: |
87 if (!ignoreUnrecognizedFlags) { | 87 if (!ignoreUnrecognizedFlags) { |
88 print('unrecognized flag: "$arg"'); | 88 print('unrecognized flag: "$arg"'); |
89 } | 89 } |
90 } | 90 } |
91 } | 91 } |
92 } | 92 } |
93 } | 93 } |
OLD | NEW |