kwo pushed a commit to branch master. http://git.enlightenment.org/e16/e16.git/commit/?id=3c5f33648e742ed0b5aefed4289223504450ec1a
commit 3c5f33648e742ed0b5aefed4289223504450ec1a Author: Kim Woelders <k...@woelders.dk> Date: Sun May 3 17:34:21 2020 +0200 groups.c: Fold "group_info" into "group" IPC command --- src/groups.c | 52 ++++++++++++++++++---------------------------------- 1 file changed, 18 insertions(+), 34 deletions(-) diff --git a/src/groups.c b/src/groups.c index 5c66cc22..791994a1 100644 --- a/src/groups.c +++ b/src/groups.c @@ -1167,26 +1167,6 @@ _GroupShow(Group * g) g->cfg.set_border, g->cfg.stick, g->cfg.shade); } -static void -IPC_GroupInfo(const char *params) -{ - Group *group; - - if (params) - { - group = _GroupFind2(params); - if (group) - _GroupShow(group); - else - IpcPrintf("Error: no such group: %s\n", params); - } - else - { - IpcPrintf("Number of groups: %d\n", LIST_GET_COUNT(&group_list)); - LIST_FOR_EACH(Group, &group_list, group) _GroupShow(group); - } -} - static void IPC_GroupOps(const char *params) { @@ -1270,13 +1250,20 @@ IPC_Group(const char *params) if (!params) { - IpcPrintf("Error: no group specified\n"); + IpcPrintf("Error: no operation specified\n"); return; } groupid[0] = operation[0] = param1[0] = '\0'; sscanf(params, "%100s %100s %100s", groupid, operation, param1); + if (!strcmp(groupid, "info")) + { + IpcPrintf("Number of groups: %d\n", LIST_GET_COUNT(&group_list)); + LIST_FOR_EACH(Group, &group_list, group) _GroupShow(group); + return; + } + if (!operation[0]) { IpcPrintf("Error: no operation specified\n"); @@ -1290,6 +1277,12 @@ IPC_Group(const char *params) return; } + if (!strcmp(operation, "info")) + { + _GroupShow(group); + return; + } + if (!param1[0]) { IpcPrintf("Error: no mode specified\n"); @@ -1306,11 +1299,6 @@ IPC_Group(const char *params) { IpcPrintf("Error: unknown mode specified\n"); } - else if (!strcmp(operation, "num_members")) - { - IpcPrintf("num_members: %d\n", group->num_members); - onoff = -1; - } else if (!strcmp(operation, "iconify")) { if (onoff >= 0) @@ -1407,12 +1395,6 @@ static const IpcItem GroupsIpcArray[] = { "Configure window groups", " groups cfg Configure groups\n"} , - { - IPC_GroupInfo, - "group_info", "gl", - "Retrieve some info on groups", - "use \"group_info [group_index]\"\n"} - , { IPC_GroupOps, "group_op", "gop", @@ -1431,9 +1413,11 @@ static const IpcItem GroupsIpcArray[] = { "Group commands", "use \"group <groupid> <property> <value>\" to set group properties.\n" "Available group commands are:\n" - " group <groupid> num_members <on/off/?>\n" + " group info\n" + " group <groupid> info\n" " group <groupid> iconify <on/off/?>\n" - " group <groupid> kill <on/off/?>\n" " group <groupid> move <on/off/?>\n" + " group <groupid> kill <on/off/?>\n" + " group <groupid> move <on/off/?>\n" " group <groupid> raise <on/off/?>\n" " group <groupid> set_border <on/off/?>\n" " group <groupid> stick <on/off/?>\n" --