diff --git a/worldedit-core/doctools/src/main/kotlin/com/sk89q/worldedit/internal/util/DocumentationPrinter.kt b/worldedit-core/doctools/src/main/kotlin/com/sk89q/worldedit/internal/util/DocumentationPrinter.kt index 0e76154c6..c6b94b86b 100644 --- a/worldedit-core/doctools/src/main/kotlin/com/sk89q/worldedit/internal/util/DocumentationPrinter.kt +++ b/worldedit-core/doctools/src/main/kotlin/com/sk89q/worldedit/internal/util/DocumentationPrinter.kt @@ -57,6 +57,7 @@ class DocumentationPrinter private constructor() { .map { it.name to it }.toList().toMap() private val cmdOutput = StringBuilder() private val permsOutput = StringBuilder() + private val matchedCommands = mutableSetOf() private suspend inline fun SequenceScope.yieldAllCommandsIn() { val sourceFile = Paths.get("worldedit-core/src/main/java/" + T::class.qualifiedName!!.replace('.', '/') + ".java") @@ -93,7 +94,7 @@ class DocumentationPrinter private constructor() { dumpSection("Selection Commands") { yieldAllCommandsIn() - yieldAllCommandsIn() + yield("/expand") } dumpSection("Region Commands") { @@ -144,6 +145,9 @@ class DocumentationPrinter private constructor() { } writeFooter() + + val missingCommands = commands.keys.filterNot { it in matchedCommands } + require(missingCommands.isEmpty()) { "Missing commands: $missingCommands" } } private fun writeHeader() { @@ -214,6 +218,7 @@ Other Permissions val prefix = TextConfig.getCommandPrefix() val commands = sequence(addCommandNames).map { this.commands.getValue(it) }.toList() + matchedCommands.addAll(commands.map { it.name }) cmdsToPerms(commands, prefix)