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

Unified Diff: lib/command_runner.dart

Issue 1603063004: Don't truncate multi-line command descriptions. (Closed) Base URL: git@github.com:dart-lang/args@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/command_runner.dart
diff --git a/lib/command_runner.dart b/lib/command_runner.dart
index 10b87ce0bfa12e8ba98e03f4f986e267ac7a295a..df1dbf86f1458a0addb9c5a3615dab3422e346e1 100644
--- a/lib/command_runner.dart
+++ b/lib/command_runner.dart
@@ -371,9 +371,15 @@ String _getCommandUsage(Map<String, Command> commands,
var buffer =
new StringBuffer('Available ${isSubcommand ? "sub" : ""}commands:');
for (var name in names) {
+ var lines = commands[name].description.split("\n");
buffer.writeln();
- buffer.write(' ${padRight(name, length)} '
- '${commands[name].description.split("\n").first}');
+ buffer.write(' ${padRight(name, length)} ${lines.first}');
+
+ for (var line in lines.skip(1)) {
+ buffer.writeln();
+ buffer.write(' ' * (length + 5));
+ buffer.write(line);
+ }
}
return buffer.toString();
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698