summaryrefslogtreecommitdiff
path: root/minecctl/minecctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'minecctl/minecctl.c')
-rw-r--r--minecctl/minecctl.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/minecctl/minecctl.c b/minecctl/minecctl.c
index b374f18..3b1da80 100644
--- a/minecctl/minecctl.c
+++ b/minecctl/minecctl.c
@@ -157,6 +157,7 @@ _noreturn_ static void usage(bool no_error)
"\n"
"Valid commands:\n"
" init perform initial setup\n"
+ " new SERVER create a new server\n"
" list list known servers\n"
" lint check validity of server configuration files\n"
" info [SERVER] show information about a running SERVER (or all known servers)\n"
@@ -178,7 +179,7 @@ _noreturn_ static void usage(bool no_error)
" -m, --mc-address=ADDR connect to Minecraft server at ADDR\n"
" (only relevant for some commands, can also\n"
" use environment variable MC_ADDRESS)\n"
- " -c, --cfgdir=DIR look for server configuration files in DIR\n"
+ " -c, --cfgdir=DIR look for configuration files in DIR\n"
" -f, --force stop server even if it has players\n"
" -v, --verbose enable extra logging\n"
" -d, --debug enable debugging information\n"
@@ -324,6 +325,17 @@ static void parse_command(struct cfg *cfg, char *const *argv)
}
cfg->cmd = do_init;
break;
+ case CMD_NEW:
+ if (!*argv) {
+ error("Missing arguments");
+ usage(false);
+ } else if (*(argv + 1)) {
+ error("Too many arguments");
+ usage(false);
+ }
+ cfg->commands = strv_copy(argv);
+ cfg->cmd = do_new;
+ break;
case CMD_LIST:
if (*argv) {
error("Too many arguments");