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.9+1"; | 17 const version = "0.2.10"; |
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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 output = stdout; | 250 output = stdout; |
251 } | 251 } |
252 | 252 |
253 output.write("""$message | 253 output.write("""$message |
254 | 254 |
255 Usage: dartfmt [-n|-w] [files or directories...] | 255 Usage: dartfmt [-n|-w] [files or directories...] |
256 | 256 |
257 ${parser.usage} | 257 ${parser.usage} |
258 """); | 258 """); |
259 } | 259 } |
OLD | NEW |