Fix usage printing for compiler plugins
This commit is contained in:
@@ -45,8 +45,10 @@ public fun cliPluginUsageString(pluginId: String, options: Collection<CliOption>
|
||||
"\n" + " ".repeat(MAX_OPTION_WIDTH + LEFT_INDENT + 1)
|
||||
} else " ".repeat(1 + MAX_OPTION_WIDTH - name.length())
|
||||
|
||||
val modifiers = (if (it.required) "required" else "") + (if (it.allowMultipleOccurrences) "multiple" else "")
|
||||
val modifiersEnclosed = if (modifiers.isNotEmpty()) " ($modifiers)" else ""
|
||||
val modifiers = listOf(
|
||||
if (it.required) "required" else null,
|
||||
if (it.allowMultipleOccurrences) "multiple" else null).filterNotNull()
|
||||
val modifiersEnclosed = if (modifiers.isEmpty()) "" else " (${modifiers.joinToString()})"
|
||||
|
||||
" ".repeat(LEFT_INDENT) + name + margin + it.description + modifiersEnclosed
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user