summaryrefslogtreecommitdiff
path: root/minecctl/misc-commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'minecctl/misc-commands.c')
-rw-r--r--minecctl/misc-commands.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/minecctl/misc-commands.c b/minecctl/misc-commands.c
index f20cac5..1268138 100644
--- a/minecctl/misc-commands.c
+++ b/minecctl/misc-commands.c
@@ -17,6 +17,30 @@ bool do_list(struct cfg *cfg)
return true;
}
+bool do_lint(struct cfg *cfg)
+{
+ struct server *server;
+ bool rv = true;
+
+ /* server->scfg.filename check excludes servers created from cmdline */
+ list_for_each_entry(server, &cfg->servers, list) {
+ if (!server->scfg.filename)
+ continue;
+
+ info("%s", server->name);
+
+ /* FIXME: should return bool */
+ server_read_config(cfg, server);
+
+ if (!scfg_validate(&server->scfg)) {
+ error("%s: invalid", server->name);
+ rv = false;
+ }
+ }
+
+ return rv;
+}
+
bool do_pcount(struct cfg *cfg)
{
unsigned x, y;