version 1.35, 2020/04/13 08:26:27 |
version 1.36, 2020/04/13 10:59:58 |
|
|
cmd_list_clients_exec(struct cmd *self, struct cmdq_item *item) |
cmd_list_clients_exec(struct cmd *self, struct cmdq_item *item) |
{ |
{ |
struct args *args = cmd_get_args(self); |
struct args *args = cmd_get_args(self); |
|
struct cmd_find_state *target = cmdq_get_target(item); |
struct client *c; |
struct client *c; |
struct session *s; |
struct session *s; |
struct format_tree *ft; |
struct format_tree *ft; |
|
|
char *line; |
char *line; |
|
|
if (args_has(args, 't')) |
if (args_has(args, 't')) |
s = item->target.s; |
s = target->s; |
else |
else |
s = NULL; |
s = NULL; |
|
|
|
|
if (c->session == NULL || (s != NULL && s != c->session)) |
if (c->session == NULL || (s != NULL && s != c->session)) |
continue; |
continue; |
|
|
ft = format_create(item->client, item, FORMAT_NONE, 0); |
ft = format_create(cmdq_get_client(item), item, FORMAT_NONE, 0); |
format_add(ft, "line", "%u", idx); |
format_add(ft, "line", "%u", idx); |
format_defaults(ft, c, NULL, NULL, NULL); |
format_defaults(ft, c, NULL, NULL, NULL); |
|
|