summaryrefslogtreecommitdiff
path: root/minecctl
diff options
context:
space:
mode:
Diffstat (limited to 'minecctl')
-rw-r--r--minecctl/misc-commands.c5
-rw-r--r--minecctl/server.c7
2 files changed, 8 insertions, 4 deletions
diff --git a/minecctl/misc-commands.c b/minecctl/misc-commands.c
index f7f2dea..a4188f9 100644
--- a/minecctl/misc-commands.c
+++ b/minecctl/misc-commands.c
@@ -20,6 +20,7 @@ bool do_list(struct cfg *cfg)
bool do_lint(struct cfg *cfg)
{
struct server *server;
+ const char *error;
bool rv = true;
/* server->scfg.filename check excludes servers created from cmdline */
@@ -32,8 +33,8 @@ bool do_lint(struct cfg *cfg)
/* FIXME: should return bool */
server_read_config(cfg, server);
- if (!scfg_validate(&server->scfg)) {
- error("%s: invalid", server->name);
+ if (!scfg_validate(&server->scfg, &error)) {
+ error("%s: invalid (%s)", server->name, error);
rv = false;
}
}
diff --git a/minecctl/server.c b/minecctl/server.c
index 21df7f4..658254f 100644
--- a/minecctl/server.c
+++ b/minecctl/server.c
@@ -10,6 +10,8 @@
void server_read_config(struct cfg *cfg, struct server *server)
{
+ unsigned lineno;
+ const char *error;
char buf[4096];
size_t off = 0;
ssize_t r;
@@ -47,8 +49,9 @@ void server_read_config(struct cfg *cfg, struct server *server)
buf[off] = '\0';
close(fd);
- if (!scfg_parse(&server->scfg, buf, NULL))
- die("Unable to parse %s", server->scfg.filename);
+ if (!scfg_parse(&server->scfg, buf, NULL, &lineno, &error))
+ die("Unable to parse %s, line %u: %s", server->scfg.filename,
+ lineno, error);
if (!server->scfg.rcon_password)
verbose("rcon password not found in %s", server->scfg.filename);