diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/test')
| -rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java b/src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java index b4a1d9e..33ed5b7 100644 --- a/src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java @@ -6,18 +6,18 @@ import cc.polyfrost.oneconfig.utils.commands.annotations.Name; import cc.polyfrost.oneconfig.utils.commands.annotations.SubCommand; import cc.polyfrost.oneconfig.libs.universal.UChat; -@Command(value = "test", aliases = {"t"}) +@Command(value = "test", aliases = {"t"}, description = "Description of the test command") public class TestCommand_Test { - @Main + @Main(description = "The main command.") private static void main() { // /test UChat.chat("Main command"); } - @SubCommand(value = "subcommand", aliases = {"s"}) + @SubCommand(value = "subcommand", aliases = {"s"}, description = "Subcommand 1.") private static class TestSubCommand { - @Main(priority = 999) + @Main(priority = 999, description = "Description of method") private static void main(int a, float b, @Name("named c") String c) { // /test subcommand <a> <b> <c> UChat.chat("Integer main: " + a + " " + b + " " + c); } @@ -32,8 +32,32 @@ public class TestCommand_Test { @Main private static void main(String a, String b, @Name("named c") String c) { // /test subcommand subsubcommand <a> <b> <c> - UChat.chat(a + " " + b + " " + c); + joinAndChat(a, b, c); } } } + + @SubCommand(value = "subcommand2", aliases = {"s2"}) + private static class TestSubCommand2 { + @Main + private static void main(boolean a, boolean b, boolean c, boolean d, boolean e, boolean f, int hgshrs, boolean jrwjhrw) { + joinAndChat(a, b, c, d, e, f, hgshrs, jrwjhrw); + } + } + + @SubCommand(value = "subcommand3", aliases = {"s3"}) + private static class TestSubCommand3 { + @Main + private static void main() { + UChat.chat("subcommand 3"); + } + } + + private static void joinAndChat(Object... stuff) { + StringBuilder builder = new StringBuilder(); + for (Object thing : stuff) { + builder.append(thing).append(" "); + } + UChat.chat(builder.toString().trim()); + } } |
