Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: bin/format.dart

Issue 1255643002: New, simpler and faster line splitter. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Optimize nesting. Reformat. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « CHANGELOG.md ('k') | example/format.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import 'package:dart_style/src/dart_formatter.dart'; 9 import 'package:dart_style/src/dart_formatter.dart';
10 import 'package:dart_style/src/formatter_exception.dart'; 10 import 'package:dart_style/src/formatter_exception.dart';
(...skipping 18 matching lines...) Expand all
29 abbr: "w", 29 abbr: "w",
30 negatable: false, 30 negatable: false,
31 help: "Overwrite input files with formatted output."); 31 help: "Overwrite input files with formatted output.");
32 parser.addFlag("machine", 32 parser.addFlag("machine",
33 abbr: "m", 33 abbr: "m",
34 negatable: false, 34 negatable: false,
35 help: "Produce machine-readable JSON output."); 35 help: "Produce machine-readable JSON output.");
36 parser.addFlag("follow-links", 36 parser.addFlag("follow-links",
37 negatable: false, 37 negatable: false,
38 help: "Follow links to files and directories.\n" 38 help: "Follow links to files and directories.\n"
39 "If unset, links will be ignored."); 39 "If unset, links will be ignored.");
40 parser.addFlag("transform", 40 parser.addFlag("transform",
41 abbr: "t", 41 abbr: "t",
42 negatable: false, 42 negatable: false,
43 help: "Unused flag for compability with the old formatter."); 43 help: "Unused flag for compability with the old formatter.");
44 44
45 var argResults; 45 var argResults;
46 try { 46 try {
47 argResults = parser.parse(args); 47 argResults = parser.parse(args);
48 } on FormatException catch (err) { 48 } on FormatException catch (err) {
49 usageError(parser, err.message); 49 usageError(parser, err.message);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 output = stdout; 207 output = stdout;
208 } 208 }
209 209
210 output.write("""$message 210 output.write("""$message
211 211
212 Usage: dartfmt [-n|-w] [files or directories...] 212 Usage: dartfmt [-n|-w] [files or directories...]
213 213
214 ${parser.usage} 214 ${parser.usage}
215 """); 215 """);
216 } 216 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | example/format.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698