summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-13 20:51:23 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-13 20:51:23 +0200
commit1285ba2d13230851c3de0a48482e735a2116de1c (patch)
tree228395424dbbe2fbe515097f5cb66026dea9bfbd /degesch.c
parenta3074ef83d001e9add8a7a35836325b0c1d574b3 (diff)
downloadxK-1285ba2d13230851c3de0a48482e735a2116de1c.tar.gz
xK-1285ba2d13230851c3de0a48482e735a2116de1c.tar.xz
xK-1285ba2d13230851c3de0a48482e735a2116de1c.zip
degesch: make "/server" alone list all servers
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/degesch.c b/degesch.c
index 7c78681..e0c75ab 100644
--- a/degesch.c
+++ b/degesch.c
@@ -7450,7 +7450,7 @@ handle_command_disconnect (struct handler_args *a)
return true;
}
-static void
+static bool
show_servers_list (struct app_context *ctx)
{
log_global_indent (ctx, "");
@@ -7461,6 +7461,7 @@ show_servers_list (struct app_context *ctx)
struct server *s;
while ((s = str_map_iter_next (&iter)))
log_global_indent (ctx, " #s", s->name);
+ return true;
}
static bool
@@ -7480,10 +7481,13 @@ static bool
handle_command_server (struct handler_args *a)
{
struct app_context *ctx = a->ctx;
+ if (!*a->arguments)
+ return show_servers_list (ctx);
+
char *action = cut_word (&a->arguments);
bool result = true;
if (!strcasecmp_ascii (action, "list"))
- show_servers_list (ctx);
+ result = show_servers_list (ctx);
else if (!strcasecmp_ascii (action, "add"))
result = handle_server_add (a);
else if (!strcasecmp_ascii (action, "remove"))