Chromium Code Reviews| Index: lib/compiler/implementation/dart2js.dart |
| diff --git a/lib/compiler/implementation/dart2js.dart b/lib/compiler/implementation/dart2js.dart |
| index 73d397bdf7fcf9834d1f5943340cbd9d16cd7238..eb355f150bd939066ae37de2a98da36276bd24b2 100644 |
| --- a/lib/compiler/implementation/dart2js.dart |
| +++ b/lib/compiler/implementation/dart2js.dart |
| @@ -79,6 +79,7 @@ void compile(List<String> argv) { |
| bool wantHelp = false; |
| bool enableColors = false; |
| String outputLanguage = 'JavaScript'; |
| + bool stripArgumentSet = false; |
| passThrough(String argument) => options.add(argument); |
| @@ -107,6 +108,11 @@ void compile(List<String> argv) { |
| passThrough(argument); |
| } |
| + setStrip(String argument) { |
| + stripArgumentSet = true; |
| + passThrough(argument); |
| + } |
| + |
| handleShortOptions(String argument) { |
| var shortOptions = argument.substring(1).splitChars(); |
| for (var shortOption in shortOptions) { |
| @@ -138,7 +144,7 @@ void compile(List<String> argv) { |
| new OptionHandler('--out=.+|-o.+', setOutput), |
| new OptionHandler('--allow-mock-compilation', passThrough), |
| new OptionHandler('--minify', passThrough), |
| - new OptionHandler('--force-cut-declaration-types', passThrough), |
| + new OptionHandler('--force-strip=.*', setStrip), |
| // TODO(ahe): Remove the --no-colors option. |
| new OptionHandler('--disable-diagnostic-colors', (_) => enableColors = false), |
| new OptionHandler('--enable-diagnostic-colors', (_) => enableColors = true), |
| @@ -156,9 +162,12 @@ void compile(List<String> argv) { |
| ]; |
| parseCommandLine(handlers, argv); |
| - |
| if (wantHelp) helpAndExit(verbose); |
| + if (outputLanguage != 'Dart' && stripArgumentSet) { |
|
ahe
2012/10/01 10:19:22
I like this check!
|
| + helpAndFail('Error: --force-strip may only be used with ' |
| + '--output-type=dart'); |
| + } |
| if (arguments.isEmpty()) { |
| helpAndFail('Error: No Dart file specified.'); |
| } |