OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library debugger; | 5 library debugger; |
6 | 6 |
7 import "dart:async"; | 7 import "dart:async"; |
8 import "dart:io"; | 8 import "dart:io"; |
9 | 9 |
10 import "package:ddbg/commando.dart"; | 10 import "package:ddbg/commando.dart"; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 var matches = _commands.match(command, true); | 153 var matches = _commands.match(command, true); |
154 if (matches.length == 0) { | 154 if (matches.length == 0) { |
155 huh(); | 155 huh(); |
156 cmdo.show(); | 156 cmdo.show(); |
157 } else if (matches.length == 1) { | 157 } else if (matches.length == 1) { |
158 matches[0].run(this, args).then((_) { | 158 matches[0].run(this, args).then((_) { |
159 cmdo.show(); | 159 cmdo.show(); |
160 }); | 160 }); |
161 } else { | 161 } else { |
162 var matchNames = matches.map((handler) => handler.name); | 162 var matchNames = matches.map((handler) => handler.name); |
163 cmdo.print("Ambigous command '$command' : ${matchNames.toList()}"); | 163 cmdo.print("Ambiguous command '$command' : ${matchNames.toList()}"); |
164 cmdo.show(); | 164 cmdo.show(); |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 } | 168 } |
169 | 169 |
170 // Every debugger command extends this base class. | 170 // Every debugger command extends this base class. |
171 abstract class Command { | 171 abstract class Command { |
172 String get name; | 172 String get name; |
173 String get helpShort; | 173 String get helpShort; |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 469 |
470 Future run(Debugger debugger, List<String> args) { | 470 Future run(Debugger debugger, List<String> args) { |
471 var cmdo = debugger.cmdo; | 471 var cmdo = debugger.cmdo; |
472 if (args.length > 1) { | 472 if (args.length > 1) { |
473 cmdo.print("Unexpected arguments to $name command."); | 473 cmdo.print("Unexpected arguments to $name command."); |
474 return new Future.value(); | 474 return new Future.value(); |
475 } | 475 } |
476 return debugger.quit(); | 476 return debugger.quit(); |
477 } | 477 } |
478 } | 478 } |
OLD | NEW |