aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/test
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-11 12:37:05 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-11 12:37:05 +0700
commit365006e6b90a08a30fffac59f84df937a1fa8916 (patch)
treead16261ae29bb0a2a3940b409e24e071eda8b8b6 /src/main/java/cc/polyfrost/oneconfig/test
parentc703f099e2af36335dd9906d7e531a58da80fbd0 (diff)
downloadOneConfig-365006e6b90a08a30fffac59f84df937a1fa8916.tar.gz
OneConfig-365006e6b90a08a30fffac59f84df937a1fa8916.tar.bz2
OneConfig-365006e6b90a08a30fffac59f84df937a1fa8916.zip
implement help command
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/test')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java34
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());
+ }
}