summaryrefslogtreecommitdiff
path: root/minecctl/minecctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'minecctl/minecctl.c')
-rw-r--r--minecctl/minecctl.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/minecctl/minecctl.c b/minecctl/minecctl.c
index 344d3d7..4a6bf0f 100644
--- a/minecctl/minecctl.c
+++ b/minecctl/minecctl.c
@@ -130,8 +130,8 @@ void dump_config(struct cfg *cfg)
info("Configuration");
info("┌────────────");
- info("│ dir_path : %s", cfg->dir_path);
- info("│ dir : %p", cfg->dir);
+ info("│ cfg_dir : %p", cfg->cfg_dir);
+ info("│ data_dir : %p", cfg->data_dir);
info("│ rcon_password : %s", cfg->rcon_password);
info("│ rcon_addrstr : %s", cfg->rcon_addrstr);
info("│ mc_addrstr : %s", cfg->mc_addrstr);
@@ -179,7 +179,6 @@ _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 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"
@@ -430,7 +429,6 @@ static void parse_cmdline(struct cfg *cfg, int argc, char *const *argv)
{ "rcon-password", required_argument, 0, 'p' },
{ "rcon-address", required_argument, 0, 'r' },
{ "mc-address", required_argument, 0, 'm' },
- { "cfgdir", required_argument, 0, 'c' },
{ "verbose", no_argument, 0, 'v' },
{ "debug", no_argument, 0, 'd' },
{ "force", no_argument, 0, 'f' },
@@ -439,7 +437,7 @@ static void parse_cmdline(struct cfg *cfg, int argc, char *const *argv)
};
/* clang-format on */
- c = getopt_long(argc, argv, ":p:r:m:c:vdfh", long_options,
+ c = getopt_long(argc, argv, ":p:r:m:vdfh", long_options,
&option_index);
if (c == -1)
@@ -455,9 +453,6 @@ static void parse_cmdline(struct cfg *cfg, int argc, char *const *argv)
case 'm':
cfg->mc_addrstr = xstrdup(optarg);
break;
- case 'c':
- cfg->dir_path = optarg;
- break;
case 'v':
debug_mask |= DBG_VERBOSE;
break;
@@ -532,7 +527,9 @@ out:
strv_free(cfg.commands);
xfree(cfg.rcon_addrstr);
xfree(cfg.mc_addrstr);
- if (cfg.dir)
- closedir(cfg.dir);
+ if (cfg.cfg_dir)
+ closedir(cfg.cfg_dir);
+ if (cfg.data_dir)
+ closedir(cfg.data_dir);
exit(success ? EXIT_SUCCESS : EXIT_FAILURE);
}