From e69aedf05964c8e3906a2426260e95423157109e Mon Sep 17 00:00:00 2001 From: wizjany Date: Wed, 5 Jun 2019 14:57:44 -0400 Subject: [PATCH] Allow clean shutdown. Rearrange command tables. --- .../internal/util/DocumentationPrinter.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java index 6352451f9..cd378d57e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java @@ -103,6 +103,8 @@ public final class DocumentationPrinter { printer.writeAllCommands(); writeOutput("commands.rst", printer.cmdOutput.toString()); writeOutput("permissions.rst", printer.permsOutput.toString()); + + WorldEdit.getInstance().getSessionManager().unload(); } private static void writeOutput(String file, String output) throws IOException { @@ -427,12 +429,14 @@ public final class DocumentationPrinter { String name = prefix + command.getName(); String desc = serializer.serialize(command.getDescription()); cmdOutput.append(".. csv-table::\n :widths: 8, 15\n\n"); - cmdOutput.append(" ").append(name).append(",\"").append(desc).append("\"\n"); + cmdOutput.append(" ").append(name).append(","); if (!command.getAliases().isEmpty()) { - cmdOutput.append(" Aliases,\"").append(String.join(", ", - command.getAliases().stream().map(a -> prefix + a).collect(Collectors.toSet()))) - .append("\"\n"); + cmdOutput.append("\"(or ").append(String.join(", ", + command.getAliases().stream().map(a -> prefix + a).collect(Collectors.toSet()))) + .append(")\""); } + cmdOutput.append("\n"); + cmdOutput.append(" Description,\"").append(desc).append("\"\n"); if (command.getCondition() instanceof PermissionCondition) { cmdOutput.append(" Permissions,\"").append(String.join(", ", ((PermissionCondition) command.getCondition()).getPermissions())).append("\"\n"); }