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

Side by Side Diff: runtime/observatory/lib/src/cli/command.dart

Issue 1255273007: Nuke some whitespace in observatory (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
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 part of cli; 5 part of cli;
6 6
7 // Splits a line into a list of string args. Each arg retains any 7 // Splits a line into a list of string args. Each arg retains any
8 // trailing whitespace so that we can reconstruct the original command 8 // trailing whitespace so that we can reconstruct the original command
9 // line from the pieces. 9 // line from the pieces.
10 List<String> _splitLine(String line) { 10 List<String> _splitLine(String line) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 } 72 }
73 return matches; 73 return matches;
74 } 74 }
75 75
76 // Returns the set of commands could be triggered by a list of 76 // Returns the set of commands could be triggered by a list of
77 // arguments. 77 // arguments.
78 List<Command> _match(List<String> args, bool preferExact) { 78 List<Command> _match(List<String> args, bool preferExact) {
79 if (args.isEmpty) { 79 if (args.isEmpty) {
80 return []; 80 return [];
81 } 81 }
82 bool lastArg = (args.length == 1); 82 bool lastArg = (args.length == 1);
83 var matches = _matchLocal(args[0], !lastArg || preferExact); 83 var matches = _matchLocal(args[0], !lastArg || preferExact);
84 if (matches.isEmpty) { 84 if (matches.isEmpty) {
85 return []; 85 return [];
86 } else if (matches.length == 1) { 86 } else if (matches.length == 1) {
87 var childMatches = matches[0]._match(args.sublist(1), preferExact); 87 var childMatches = matches[0]._match(args.sublist(1), preferExact);
88 if (childMatches.isEmpty) { 88 if (childMatches.isEmpty) {
89 return matches; 89 return matches;
90 } else { 90 } else {
91 return childMatches; 91 return childMatches;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 if (_parent is RootCommand) { 240 if (_parent is RootCommand) {
241 return name; 241 return name;
242 } else { 242 } else {
243 Command parent = _parent; 243 Command parent = _parent;
244 return '${parent.fullName} $name'; 244 return '${parent.fullName} $name';
245 } 245 }
246 } 246 }
247 247
248 toString() => 'Command(${name})'; 248 toString() => 'Command(${name})';
249 } 249 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/service_io.dart ('k') | runtime/observatory/lib/src/debugger/debugger_location.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698