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
@@ -52,7 +52,7 @@ public abstract class CommonCompilerArguments {
@ValueDescription("<path>")
public String[] pluginClasspaths;
@Argument(value = "P", description = "\n Pass an option to a plugin")
@Argument(value = "P", description = "Pass an option to a plugin")
@ValueDescription(PLUGIN_OPTION_FORMAT)
public String[] pluginOptions;
@@ -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();