From 47b4796695e6c6234d35ad7b8652298dc4e4e12c Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Thu, 4 Jul 2024 08:51:27 -0400 Subject: [PATCH] fix subcomamnds not having options --- src/main/java/cc/fascinated/bat/command/BatCommand.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/command/BatCommand.java b/src/main/java/cc/fascinated/bat/command/BatCommand.java index b801c44..79435f7 100644 --- a/src/main/java/cc/fascinated/bat/command/BatCommand.java +++ b/src/main/java/cc/fascinated/bat/command/BatCommand.java @@ -103,6 +103,9 @@ public abstract class BatCommand { } command.setSubcommandData(new SubcommandData(command.getInfo().getName(), command.getInfo().getDescription())); + for (OptionData option : command.getCommandData().getOptions()) { + command.getSubcommandData().addOptions(option); + } commandData.addSubcommands(command.getSubcommandData()); subCommands.put(command.getInfo().getName(), command); } @@ -115,10 +118,6 @@ public abstract class BatCommand { * @param options the options to add */ protected final void addOptions(OptionData... options) { - if (subcommandData != null) { - subcommandData.addOptions(options); - } else { - commandData.addOptions(options); - } + commandData.addOptions(options); } } \ No newline at end of file