| 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 args.src.usage; | |
| 6 | |
| 7 import 'dart:math'; | 5 import 'dart:math'; |
| 8 | 6 |
| 9 import '../args.dart'; | 7 import '../args.dart'; |
| 10 | 8 |
| 11 /// Takes an [ArgParser] and generates a string of usage (i.e. help) text for | 9 /// Takes an [ArgParser] and generates a string of usage (i.e. help) text for |
| 12 /// its defined options. | 10 /// its defined options. |
| 13 /// | 11 /// |
| 14 /// Internally, it works like a tabular printer. The output is divided into | 12 /// Internally, it works like a tabular printer. The output is divided into |
| 15 /// three horizontal columns, like so: | 13 /// three horizontal columns, like so: |
| 16 /// | 14 /// |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 String padRight(String source, int length) { | 242 String padRight(String source, int length) { |
| 245 final result = new StringBuffer(); | 243 final result = new StringBuffer(); |
| 246 result.write(source); | 244 result.write(source); |
| 247 | 245 |
| 248 while (result.length < length) { | 246 while (result.length < length) { |
| 249 result.write(' '); | 247 result.write(' '); |
| 250 } | 248 } |
| 251 | 249 |
| 252 return result.toString(); | 250 return result.toString(); |
| 253 } | 251 } |
| OLD | NEW |