Minor, break the line in "kotlinc -help" if it's too long

To improve description of the "pluginOptions" flag
This commit is contained in:
Alexander Udalov
2016-05-10 22:11:31 +03:00
parent 1a8181bdc4
commit dcb2d7b4f6
2 changed files with 9 additions and 2 deletions
@@ -72,9 +72,16 @@ class Usage {
sb.append(" ");
sb.append(description.value());
}
while (sb.length() < OPTION_NAME_PADDING_WIDTH - 1) {
int width = OPTION_NAME_PADDING_WIDTH - 1;
if (sb.length() >= width + 5) { // Break the line if it's too long
sb.append("\n");
width += sb.length();
}
while (sb.length() < width) {
sb.append(" ");
}
sb.append(" ");
sb.append(argument.description());
return sb.toString();