| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:convert'; | 5 import 'dart:convert'; |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 | 7 |
| 8 import 'package:args/args.dart'; | 8 import 'package:args/args.dart'; |
| 9 | 9 |
| 10 import 'package:dart_style/src/dart_formatter.dart'; | 10 import 'package:dart_style/src/dart_formatter.dart'; |
| 11 import 'package:dart_style/src/formatter_exception.dart'; | 11 import 'package:dart_style/src/formatter_exception.dart'; |
| 12 import 'package:dart_style/src/formatter_options.dart'; | 12 import 'package:dart_style/src/formatter_options.dart'; |
| 13 import 'package:dart_style/src/io.dart'; | 13 import 'package:dart_style/src/io.dart'; |
| 14 import 'package:dart_style/src/source_code.dart'; | 14 import 'package:dart_style/src/source_code.dart'; |
| 15 | 15 |
| 16 // Note: The following line of code is modified by tool/grind.dart. | 16 // Note: The following line of code is modified by tool/grind.dart. |
| 17 const version = "0.2.2"; | 17 const version = "0.2.3"; |
| 18 | 18 |
| 19 void main(List<String> args) { | 19 void main(List<String> args) { |
| 20 var parser = new ArgParser(allowTrailingOptions: true); | 20 var parser = new ArgParser(allowTrailingOptions: true); |
| 21 | 21 |
| 22 parser.addFlag("help", | 22 parser.addFlag("help", |
| 23 abbr: "h", negatable: false, help: "Shows usage information."); | 23 abbr: "h", negatable: false, help: "Shows usage information."); |
| 24 parser.addFlag("version", | 24 parser.addFlag("version", |
| 25 negatable: false, help: "Shows version information."); | 25 negatable: false, help: "Shows version information."); |
| 26 parser.addOption("line-length", | 26 parser.addOption("line-length", |
| 27 abbr: "l", help: "Wrap lines longer than this.", defaultsTo: "80"); | 27 abbr: "l", help: "Wrap lines longer than this.", defaultsTo: "80"); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 output = stdout; | 243 output = stdout; |
| 244 } | 244 } |
| 245 | 245 |
| 246 output.write("""$message | 246 output.write("""$message |
| 247 | 247 |
| 248 Usage: dartfmt [-n|-w] [files or directories...] | 248 Usage: dartfmt [-n|-w] [files or directories...] |
| 249 | 249 |
| 250 ${parser.usage} | 250 ${parser.usage} |
| 251 """); | 251 """); |
| 252 } | 252 } |
| OLD | NEW |