From fa42c698a4d79fc34ef60df08041cadc5b85f44f Mon Sep 17 00:00:00 2001 From: Alex Gryczewski Date: Mon, 27 Feb 2023 14:18:43 -0500 Subject: [PATCH] Fix help usage. Upgrade to enhanced switch --- .../commands/developer/PermissionCommand.java | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/main/java/dev/salmonllama/fsbot/commands/developer/PermissionCommand.java b/src/main/java/dev/salmonllama/fsbot/commands/developer/PermissionCommand.java index 5562901..27e1b31 100644 --- a/src/main/java/dev/salmonllama/fsbot/commands/developer/PermissionCommand.java +++ b/src/main/java/dev/salmonllama/fsbot/commands/developer/PermissionCommand.java @@ -18,7 +18,7 @@ import java.util.List; public class PermissionCommand extends Command { @Override public String name() { return "Permission"; } @Override public String description() { return "Manages a user's static permissions"; } - @Override public String usage() { return "permission "; } + @Override public String usage() { return "permission <@usermention> "; } @Override public CommandCategory category() { return CommandCategory.DEVELOPER; } @Override public CommandPermission permission() { return new CommandPermission(PermissionType.OWNER); } @Override public List aliases() { return Arrays.asList("permission", "permissions", "perm", "perms"); } @@ -27,21 +27,19 @@ public class PermissionCommand extends Command { public void onCommand(CommandContext ctx) { String[] args = ctx.getArgs(); - switch(args[0]) { - case "list": + switch (args[0]) { + case "list" -> // List all the static permissions - list(ctx); - break; - case "add": + list(ctx); + case "add" -> // Add a static permission to the mentioned user, if any - add(ctx); - break; - case "remove": + add(ctx); + case "remove" -> // Remove a static permission from the mentioned user, if any - remove(ctx); - break; - default: - // You don't know how to use this command LUL + remove(ctx); + default -> { + } + // You don't know how to use this command LUL } }