| 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:convert'; |
| 7 import 'dart:io'; | 8 import 'dart:io'; |
| 8 | 9 |
| 9 import 'package:args/args.dart'; | 10 import 'package:args/args.dart'; |
| 10 | 11 |
| 11 import 'package:analyzer_experimental/src/services/formatter_impl.dart'; | 12 import 'package:analyzer_experimental/src/services/formatter_impl.dart'; |
| 12 | 13 |
| 13 | 14 |
| 14 const BINARY_NAME = 'dartfmt'; | 15 const BINARY_NAME = 'dartfmt'; |
| 15 final argParser = _initArgParser(); | 16 final argParser = _initArgParser(); |
| 16 | 17 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 85 |
| 85 /// Format the given [src] as a compilation unit. | 86 /// Format the given [src] as a compilation unit. |
| 86 String _formatCU(src, {options: const FormatterOptions()}) => | 87 String _formatCU(src, {options: const FormatterOptions()}) => |
| 87 new CodeFormatter(options).format(CodeKind.COMPILATION_UNIT, src); | 88 new CodeFormatter(options).format(CodeKind.COMPILATION_UNIT, src); |
| 88 | 89 |
| 89 /// Log the given [msg]. | 90 /// Log the given [msg]. |
| 90 _log(String msg) { | 91 _log(String msg) { |
| 91 //TODO(pquitslund): add proper log support | 92 //TODO(pquitslund): add proper log support |
| 92 print(msg); | 93 print(msg); |
| 93 } | 94 } |
| OLD | NEW |