| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 options; | 5 library options; |
| 6 | 6 |
| 7 import 'package:args/args.dart'; | 7 import 'package:args/args.dart'; |
| 8 | 8 |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 //"eat" params by advancing to the next flag/option | 244 //"eat" params by advancing to the next flag/option |
| 245 i = _getNextFlagIndex(args, i); | 245 i = _getNextFlagIndex(args, i); |
| 246 } else { | 246 } else { |
| 247 filtered.add(arg); | 247 filtered.add(arg); |
| 248 } | 248 } |
| 249 } else { | 249 } else { |
| 250 filtered.add(arg); | 250 filtered.add(arg); |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 | 253 |
| 254 print(filtered); | |
| 255 return filtered; | 254 return filtered; |
| 256 } | 255 } |
| 257 | 256 |
| 258 _getNextFlagIndex(args, i) { | 257 _getNextFlagIndex(args, i) { |
| 259 for ( ; i < args.length; ++i) { | 258 for ( ; i < args.length; ++i) { |
| 260 if (args[i].startsWith('--')) { | 259 if (args[i].startsWith('--')) { |
| 261 return i; | 260 return i; |
| 262 } | 261 } |
| 263 } | 262 } |
| 264 return i; | 263 return i; |
| 265 } | 264 } |
| 266 } | 265 } |
| OLD | NEW |