summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-25 17:01:59 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-25 17:01:59 +0200
commit28606456dd6b110326c3027ea078b0409afeba3b (patch)
treeb6cbed48f3daba6536ad92fe051ad14411422dde
parent4d0fcab10e91ad5962837f7dd428f5bca1c8c980 (diff)
Oops, missed one file
-rw-r--r--minecctl/minecctl-commands.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/minecctl/minecctl-commands.h b/minecctl/minecctl-commands.h
new file mode 100644
index 0000000..17cf610
--- /dev/null
+++ b/minecctl/minecctl-commands.h
@@ -0,0 +1,67 @@
+#ifndef foominecctlcommandshfoo
+#define foominecctlcommandshfoo
+
+enum commands {
+ CMD_INVALID = 0,
+ CMD_LIST,
+ CMD_STATUS,
+ CMD_PING,
+ CMD_STOP,
+ CMD_STOPALL,
+ CMD_PCOUNT,
+ CMD_COMMAND,
+ CMD_CONSOLE,
+};
+
+enum command_args {
+ CMD_ARG_INVALID = 0,
+ CMD_ARG_NONE,
+ CMD_ARG_ONE_OPTIONAL,
+ CMD_ARG_AT_LEAST_ONE,
+};
+
+static struct command_list {
+ const char *name;
+ enum commands cmd;
+ enum command_args args;
+} command_list[] = {
+ {
+ .name = "list",
+ .cmd = CMD_LIST,
+ .args = CMD_ARG_NONE,
+ }, {
+ .name = "status",
+ .cmd = CMD_STATUS,
+ .args = CMD_ARG_ONE_OPTIONAL,
+ }, {
+ .name = "ping",
+ .cmd = CMD_PING,
+ .args = CMD_ARG_ONE_OPTIONAL,
+ }, {
+ .name = "stop",
+ .cmd = CMD_STOP,
+ .args = CMD_ARG_ONE_OPTIONAL,
+ }, {
+ .name = "stopall",
+ .cmd = CMD_STOPALL,
+ .args = CMD_ARG_NONE,
+ }, {
+ .name = "pcount",
+ .cmd = CMD_PCOUNT,
+ .args = CMD_ARG_ONE_OPTIONAL,
+ }, {
+ .name = "cmd",
+ .cmd = CMD_COMMAND,
+ .args = CMD_ARG_AT_LEAST_ONE,
+ }, {
+ .name = "console",
+ .cmd = CMD_CONSOLE,
+ .args = CMD_ARG_ONE_OPTIONAL,
+ }, {
+ .name = NULL,
+ .cmd = CMD_INVALID,
+ .args = CMD_ARG_INVALID,
+ }
+};
+
+#endif