3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 02:50:05 +01:00

Allow clean shutdown.

Rearrange command tables.
Dieser Commit ist enthalten in:
wizjany 2019-06-05 14:57:44 -04:00
Ursprung e767dd9888
Commit e69aedf059

Datei anzeigen

@ -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");
}