degesch: make "/server" alone list all servers
This commit is contained in:
parent
a3074ef83d
commit
1285ba2d13
|
@ -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"))
|
||||
|
|
Loading…
Reference in New Issue