aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-11 10:30:06 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-11 10:30:06 +0200
commit1ab7422957a76158883e0449ed593ac216c9ef80 (patch)
treeeb3bb5434a1b860941f85d2fdb543264d094f2de /src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java
parentd888d6b7358226792bf0cedbe67c7bb26204983f (diff)
parentf3aac4876936dc58e6251bffae4a203d7b964051 (diff)
downloadOneConfig-1ab7422957a76158883e0449ed593ac216c9ef80.tar.gz
OneConfig-1ab7422957a76158883e0449ed593ac216c9ef80.tar.bz2
OneConfig-1ab7422957a76158883e0449ed593ac216c9ef80.zip
Merge branch 'master' of github.com:Polyfrost/OneConfig
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java36
1 files changed, 30 insertions, 6 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 31a503b..33ed5b7 100644
--- a/src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java
+++ b/src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java
@@ -4,20 +4,20 @@ import cc.polyfrost.oneconfig.utils.commands.annotations.Command;
import cc.polyfrost.oneconfig.utils.commands.annotations.Main;
import cc.polyfrost.oneconfig.utils.commands.annotations.Name;
import cc.polyfrost.oneconfig.utils.commands.annotations.SubCommand;
-import gg.essential.universal.UChat;
+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());
+ }
}