diff --git a/core/src/main/java/dev/velix/imperat/CommandRegistrar.java b/core/src/main/java/dev/velix/imperat/CommandRegistrar.java index 41c0ec4..a32341a 100644 --- a/core/src/main/java/dev/velix/imperat/CommandRegistrar.java +++ b/core/src/main/java/dev/velix/imperat/CommandRegistrar.java @@ -10,12 +10,24 @@ public sealed interface CommandRegistrar permits Imperat { /** - * Registering a command into the dispatcher + * Registers a command into the dispatcher * * @param command the command to register */ void registerCommand(Command command); + /** + * Registers some commands into the dispatcher + * + * @param commands the commands to register + */ + @SuppressWarnings("all") + default void registerCommands(Command... commands) { + for (final var command : commands) { + this.registerCommand(command); + } + } + /** * Registers a command class built by the * annotations using a parser @@ -24,6 +36,18 @@ public sealed interface CommandRegistrar permits Imperat { */ void registerCommand(Object command); + /** + * Registers some commands into the dispatcher + * annotations using a parser + * + * @param commands the commands to register + */ + default void registerCommands(Object... commands) { + for (final var command : commands) { + this.registerCommand(command); + } + } + /** * Unregisters a command from the internal registry *