| OLD | NEW |
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 | 2 |
| 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 4 // for details. All rights reserved. Use of this source code is governed by a | 4 // for details. All rights reserved. Use of this source code is governed by a |
| 5 // BSD-style license that can be found in the LICENSE file. | 5 // BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'dart:utf'; | 8 import 'dart:utf'; |
| 9 | 9 |
| 10 import 'package:args/args.dart'; | 10 import 'package:args/args.dart'; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 'standard output.') | 109 'standard output.') |
| 110 ..write('\n\n') | 110 ..write('\n\n') |
| 111 ..write('Supported flags are:') | 111 ..write('Supported flags are:') |
| 112 ..write('Usage: $BINARY_NAME [flags] [path...]\n\n') | 112 ..write('Usage: $BINARY_NAME [flags] [path...]\n\n') |
| 113 ..write('${argParser.getUsage()}\n\n'); | 113 ..write('${argParser.getUsage()}\n\n'); |
| 114 _log(buffer.toString()); | 114 _log(buffer.toString()); |
| 115 } | 115 } |
| 116 | 116 |
| 117 /// Format the given [src] as a compilation unit. | 117 /// Format the given [src] as a compilation unit. |
| 118 String _formatCU(src, {options: const FormatterOptions()}) => | 118 String _formatCU(src, {options: const FormatterOptions()}) => |
| 119 new CodeFormatter(options).format(CodeKind.COMPILATION_UNIT, src); | 119 new CodeFormatter(options).format(CodeKind.COMPILATION_UNIT, src).source; |
| 120 | 120 |
| 121 /// Log the given [msg]. | 121 /// Log the given [msg]. |
| 122 _log(String msg) { | 122 _log(String msg) { |
| 123 //TODO(pquitslund): add proper log support | 123 //TODO(pquitslund): add proper log support |
| 124 print(msg); | 124 print(msg); |
| 125 } | 125 } |
| OLD | NEW |