kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=f0029d9f633754497ed179512d8574868271b4b3

commit f0029d9f633754497ed179512d8574868271b4b3
Author: Kim Woelders <k...@woelders.dk>
Date:   Tue May 5 15:56:02 2020 +0200

    groups.c: Add group list ipc comand
---
 src/groups.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/src/groups.c b/src/groups.c
index a0080327..3c786370 100644
--- a/src/groups.c
+++ b/src/groups.c
@@ -1161,6 +1161,35 @@ _GroupsConfigure(const char *params)
  * Groups module
  */
 
+static void
+_GroupShowEwins(Group * g)
+{
+   int                 i;
+
+   IpcPrintf(" gid=%8d: ", g->index);
+   for (i = 0; i < g->num_members; i++)
+      IpcPrintf(" %s", EoGetName(g->members[i]));
+   IpcPrintf("\n");
+}
+
+static void
+_GroupsShowGroups(void)
+{
+   Group              *g;
+
+   IpcPrintf("%s:\n", __func__);
+   LIST_FOR_EACH(Group, &group_list, g)
+   {
+      _GroupShowEwins(g);
+   }
+}
+
+static void
+_GroupsShow(void)
+{
+   _GroupsShowGroups();
+}
+
 static void
 _GroupShow(Group * g)
 {
@@ -1275,6 +1304,11 @@ IPC_Group(const char *params)
        LIST_FOR_EACH(Group, &group_list, group) _GroupShow(group);
        return;
      }
+   else if (!strcmp(groupid, "list"))
+     {
+       _GroupsShow();
+       return;
+     }
 
    if (!operation[0])
      {

-- 


Reply via email to