| 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 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) { |
| 11 line = line.trimLeft(); | 11 line = line.trimLeft(); |
| 12 var args = []; | 12 var args = []; |
| 13 var codes = line.codeUnits; | |
| 14 | |
| 15 int pos = 0; | 13 int pos = 0; |
| 16 while (pos < line.length) { | 14 while (pos < line.length) { |
| 17 int startPos = pos; | 15 int startPos = pos; |
| 18 | 16 |
| 19 // Advance to end of word. | 17 // Advance to end of word. |
| 20 for (; pos < line.length && line[pos] != ' '; pos++); | 18 for (; pos < line.length && line[pos] != ' '; pos++); |
| 21 | 19 |
| 22 // Advance to end of spaces. | 20 // Advance to end of spaces. |
| 23 for (; pos < line.length && line[pos] == ' '; pos++); | 21 for (; pos < line.length && line[pos] == ' '; pos++); |
| 24 | 22 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 if (_parent is RootCommand) { | 240 if (_parent is RootCommand) { |
| 243 return name; | 241 return name; |
| 244 } else { | 242 } else { |
| 245 Command parent = _parent; | 243 Command parent = _parent; |
| 246 return '${parent.fullName} $name'; | 244 return '${parent.fullName} $name'; |
| 247 } | 245 } |
| 248 } | 246 } |
| 249 | 247 |
| 250 toString() => 'Command(${name})'; | 248 toString() => 'Command(${name})'; |
| 251 } | 249 } |
| OLD | NEW |